[Mono-bugs] [Bug 74999][Maj] New - Invalid IL code with anonymous method/variable interaction

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu May 19 21:01:53 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 emrysk at gmail.com.

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

--- shadow/74999	2005-05-19 21:01:53.000000000 -0400
+++ shadow/74999.tmp.9719	2005-05-19 21:01:53.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 74999
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: Ubuntu Linux 5.04 (Hoary)
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Major
+Component: JIT
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: emrysk at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Invalid IL code with anonymous method/variable interaction
+
+I'm using Mono 1.1.7 built from source.  I get an "Invalid IL code" error
+when compiling and running the following:
+
+class X<T> {
+	public T eh;
+}
+
+static class Program {
+	delegate void D<T> (X<T> o);
+	static event D<bool> E;
+	
+	static void Main()
+	{
+		bool running = true;
+
+		E = delegate(X<bool> o) {
+			o.eh = false;
+			running = false;
+		};
+
+		X<bool> x = new X<bool>();
+		running = true;
+		E(x);
+		
+		while (running)
+			continue;
+	}
+}
+
+... which I compile with "gmcs crashcase.cs" and run with "mono crashcase.exe".
+
+$ mono crashcase.exe
+
+** ERROR **: Invalid IL code at IL0007 in Program:Main (): IL_0007: ldarg.0
+
+
+aborting...
+Aborted
+
+
+This error does not occur if I comment out either "o.eh = false;" or
+"running = false;" in the anonymous method.  (Or if I comment out both, of
+course.)


More information about the mono-bugs mailing list