[Mono-bugs] [Bug 71783][Wis] Changed - Nested anonymous delegates causes gmcs exception

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 26 Jan 2005 14:45:36 -0500 (EST)


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 ximian@asaj.org.

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

--- shadow/71783	2005-01-26 12:08:03.000000000 -0500
+++ shadow/71783.tmp.24802	2005-01-26 14:45:36.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 71783
 Product: Mono: Compilers
 Version: 1.1
-OS: 
+OS: GNU/Linux [Other]
 OS Details: Gentoo 2.6.9-r4
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: ximian@asaj.org               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -87,6 +87,76 @@
       Foo d=delegate(int z) { return 0; };
       return x;
     };
   }
 
 }
+
+------- Additional Comments From ximian@asaj.org  2005-01-26 14:45 -------
+A probably related problem.  The following code:
+
+public delegate void Thunk();
+
+class Test {
+
+  void Weird() {
+    string h = "hello"; string w = "world";
+    Thunk t2=delegate() { string x = h; };
+    Thunk t3=delegate() { Thunk y = t2; string z = w; };
+  }
+
+}
+
+results in the following stack trace:
+
+Unhandled Exception: System.Exception: Never found block 1 starting at
+3 while looking up w
+in <0x00187> Mono.CSharp.CaptureContext:EmitCapturedVariableInstance
+(Mono.CSharp.EmitContext,Mono.CSharp.LocalInfo,Mono.CSharp.AnonymousMethod)
+in <0x00071> Mono.CSharp.EmitContext:EmitCapturedVariableInstance
+(Mono.CSharp.LocalInfo)
+in <0x00057> Mono.CSharp.LocalVariableReference:Emit
+(Mono.CSharp.EmitContext)
+in <0x00063> Mono.CSharp.LocalVariableReference:EmitAssign
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression,bool,bool)
+in <0x001b0> Mono.CSharp.Assign:Emit (Mono.CSharp.EmitContext,bool)
+in <0x00012> Mono.CSharp.Assign:EmitStatement (Mono.CSharp.EmitContext)
+in <0x00011> Mono.CSharp.StatementExpression:DoEmit
+(Mono.CSharp.EmitContext)
+in <0x00024> Mono.CSharp.Statement:Emit (Mono.CSharp.EmitContext)
+in <0x00079> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext)
+in <0x00298> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x00079> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext)
+in <0x00298> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x0001a> Mono.CSharp.EmitContext:EmitResolvedTopBlock
+(Mono.CSharp.ToplevelBlock,bool)
+in <0x000cf> Mono.CSharp.AnonymousMethod:EmitMethod
+(Mono.CSharp.EmitContext)
+in <0x0001a> Mono.CSharp.AnonymousDelegate:Emit (Mono.CSharp.EmitContext)
+in <0x00063> Mono.CSharp.LocalVariableReference:EmitAssign
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression,bool,bool)
+in <0x001b0> Mono.CSharp.Assign:Emit (Mono.CSharp.EmitContext,bool)
+in <0x00012> Mono.CSharp.Assign:EmitStatement (Mono.CSharp.EmitContext)
+in <0x00011> Mono.CSharp.StatementExpression:DoEmit
+(Mono.CSharp.EmitContext)
+in <0x00024> Mono.CSharp.Statement:Emit (Mono.CSharp.EmitContext)
+in <0x00079> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext)
+in <0x00298> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x00079> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext)
+in <0x00298> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x00079> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext)
+in <0x00298> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x00079> Mono.CSharp.Block:DoEmit (Mono.CSharp.EmitContext)
+in <0x00298> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x0001a> Mono.CSharp.EmitContext:EmitResolvedTopBlock
+(Mono.CSharp.ToplevelBlock,bool)
+in <0x00062> Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.ToplevelBlock,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x00469> Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Attributable)
+in <0x00027> Mono.CSharp.Method:Emit ()
+in <0x005da> Mono.CSharp.TypeContainer:EmitType ()
+in <0x0045c> Mono.CSharp.RootContext:EmitCode ()
+in <0x00d17> Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000f> Mono.CSharp.Driver:Main (string[])
+
+