[Mono-bugs] [Bug 79660][Nor] New - Compilation of chained assignment in anonymous delegate context fails

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Oct 14 05:02:44 EDT 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 horst.reiterer at mind-breeze.com.

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

--- shadow/79660	2006-10-14 05:02:44.000000000 -0400
+++ shadow/79660.tmp.14251	2006-10-14 05:02:44.000000000 -0400
@@ -0,0 +1,91 @@
+Bug#: 79660
+Product: Mono: Compilers
+Version: 1.1
+OS: other
+OS Details: Red Hat Enterprise Linux 4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: horst.reiterer at mind-breeze.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compilation of chained assignment in anonymous delegate context fails
+
+Compiling the following testcase succeeds with csc but fails with gmcs
+(1.1.13.6):
+
+  delegate void TestDelegate();
+
+  public class Test
+  {
+    static void Main()
+    {
+      uint a = 0;
+      uint b = 0;
+
+      TestDelegate d = delegate {
+        // Compilation of chained assignment fails
+        a = b = 0;
+        Consume(a);
+        Consume(b);
+      };
+    }
+
+    static void Consume(uint x)
+    {
+    }
+  };
+
+Steps to reproduce the problem:
+1. gmcs testcase.cs
+
+Actual Results:
+
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: testcase.cs(10,22):
+                     Block being compiled:
+[testcase.cs(10,31):,testcase.cs(15,5):]
+System.NullReferenceException: Object reference not set to an instance of
+an object
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: testcase.cs(5,15):
+                     Block being compiled: [testcase.cs(10,5):,Internal(1,1):]
+System.NullReferenceException: Object reference not set to an instance of
+an object
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00122> Mono.CSharp.EmitContext:GetTemporaryLocal (System.Type t)
+in <0x0006b> Mono.CSharp.LocalTemporary:.ctor (Mono.CSharp.EmitContext ec,
+System.Type t, Boolean is_address)
+in <0x00012> Mono.CSharp.LocalTemporary:.ctor (Mono.CSharp.EmitContext ec,
+System.Type t)
+in <0x008b2> Mono.CSharp.Assign:DoResolve (Mono.CSharp.EmitContext ec)
+in <0x000e3> Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags)
+in <0x00012> Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext ec)
+in <0x000d0> Mono.CSharp.Assign:DoResolve (Mono.CSharp.EmitContext ec)
+in <0x000e3> Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags)
+in <0x00012> Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext ec)
+in <0x00013> Mono.CSharp.ExpressionStatement:ResolveStatement
+(Mono.CSharp.EmitContext ec)
+in <0x0001f> Mono.CSharp.StatementExpression:Resolve
+(Mono.CSharp.EmitContext ec)
+in <0x001d9> Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext ec)
+in <0x00122> Mono.CSharp.EmitContext:ResolveTopBlock
+(Mono.CSharp.EmitContext anonymous_method_host, Mono.CSharp.ToplevelBlock
+block, Mono.CSharp.Parameters ip, IMethodData md, System.Boolean unreachable)
+
+Expected Results:
+
+Successful compilation.
+
+How often does this happen? 
+
+100 out of 100 times


More information about the mono-bugs mailing list