[Mono-bugs] [Bug 75862][Nor] New - Invalid IL code generated by mcs when calling destructor

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Aug 20 10:36:16 EDT 2005


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 joe at otee.dk.

http://bugzilla.ximian.com/show_bug.cgi?id=75862

--- shadow/75862	2005-08-20 10:36:16.000000000 -0400
+++ shadow/75862.tmp.32751	2005-08-20 10:36:16.000000000 -0400
@@ -0,0 +1,44 @@
+Bug#: 75862
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: joe at otee.dk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary:  Invalid IL code generated by mcs when calling destructor
+
+Compile and run this sample. This will give you:
+** ERROR **: Invalid IL code at IL0005 in Test:Main (): IL_0005: not       
+aborting...
+Abort trap
+
+I presume the mcs should give a compile error, but it could also be a runtime problem.
+
+
+
+using System;
+public struct LayerMask
+{
+	private ushort mask;
+	public static implicit operator int (LayerMask mask) { return (int)mask.mask; }
+	public static implicit operator LayerMask (int intVal) { LayerMask mask; mask.mask = 
+unchecked ((ushort)intVal); return mask; }
+}
+
+class Test
+{
+	static private LayerMask test;
+	static public void Main ()
+	{
+		LayerMask a = ~test;
+	}
+}


More information about the mono-bugs mailing list