[Mono-bugs] [Bug 77958][Maj] New - Unhandled exception in gmcs: switch over ulong

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Mar 30 03:49:43 EST 2006

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by pawel.sakowski at mind-breeze.com.


--- shadow/77958	2006-03-30 03:49:43.000000000 -0500
+++ shadow/77958.tmp.17335	2006-03-30 03:49:43.000000000 -0500
@@ -0,0 +1,62 @@
+Bug#: 77958
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Major
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: pawel.sakowski at mind-breeze.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Unhandled exception in gmcs: switch over ulong
+Description of Problem:
+The compiler crasher when compiling a switch/case over ulong values.
+Steps to reproduce the problem:
+1. Compile with gmcs:
+class X{
+static void Main(){
+ulong x=1;
+switch (x) {
+case 0:break;
+Actual Results:
+Unhandled Exception: System.InvalidCastException: Cannot cast from source
+type to destination type.
+in <0x002ee> Mono.CSharp.Switch:EmitObjectInteger
+(System.Reflection.Emit.ILGenerator ig, System.Object k)
+in <0x00931> Mono.CSharp.Switch:TableSwitchEmit (Mono.CSharp.EmitContext
+ec, System.Reflection.Emit.LocalBuilder val)
+in <0x00106> Mono.CSharp.Switch:DoEmit (Mono.CSharp.EmitContext ec)
+in <0x00024> Mono.CSharp.Statement:Emit (Mono.CSharp.EmitContext ec)
+in <0x000a8> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext ec)
+in <0x00268> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext ec)
+in <0x0001b> Mono.CSharp.EmitContext:EmitResolvedTopBlock
+(Mono.CSharp.ToplevelBlock block, Boolean unreachable)
+in <0x0007e> Mono.CSharp.EmitContext:EmitTopBlock (IMethodData md,
+Mono.CSharp.ToplevelBlock block)
+in <0x001c0> Mono.CSharp.MethodData:Emit (Mono.CSharp.TypeContainer
+container, Mono.CSharp.Attributable kind)
+in <0x00030> Mono.CSharp.Method:Emit ()
+in <0x0072d> Mono.CSharp.TypeContainer:EmitType ()
+in <0x00226> Mono.CSharp.RootContext:EmitCode ()
+in <0x00a9f> Mono.CSharp.Driver:MainDriver (System.String[] args)
+in <0x00051> Mono.CSharp.Driver:Main (System.String[] args)
+Expected Results:
+Successful compilation, as with the MS compiler.
+How often does this happen? 

More information about the mono-bugs mailing list