Bug 318019 (MONO74979) - Problem with switch and break
Summary: Problem with switch and break
Status: RESOLVED MOVED
Alias: MONO74979
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.0
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-17 20:47 UTC by Ben Maurer
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:17:50 UTC


---- Reported by bmaurer@users.sf.net 2005-05-17 13:47:49 MST ----

using System;
class X {
	static bool A = true;
	static char c = 'e';
	
	static void Main ()
	{
		switch (c) {
			case 'e': 
				if (A)
					break;
				return;
			
			default: 
				return;
		}
		
		Console.WriteLine ("Good");
	}
}

mcs compiled binary outputs nothing. It should output good.



---- Additional Comments From bmaurer@users.sf.net 2005-05-17 13:53:49 MST ----

This looks like it is for Martin. the compiler thinks the CWL is
unreachable, and it is not emitted:

        IL_0000:  ldsfld  char X::c
        IL_0005:  stloc.0
        IL_0006:  ldloc.0
        IL_0007:  ldc.i4.s 0x65
        IL_0009:  beq IL_0013
 
        IL_000e:  br IL_0023
 
        IL_0013:  ldsfld  bool X::A
        IL_0018:  brfalse IL_0022
 
        IL_001d:  br IL_0024
 
        IL_0022:  ret
        IL_0023:  ret
        IL_0024:  ret




---- Additional Comments From bmaurer@users.sf.net 2005-05-17 14:36:01 MST ----



*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO74978 ***


Unknown operating system unknown. Setting to default OS "Other".
This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"