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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=76957 --- shadow/76957 2005-12-09 05:35:44.000000000 -0500 +++ shadow/76957.tmp.16722 2005-12-09 05:35:44.000000000 -0500 @@ -0,0 +1,53 @@ +Bug#: 76957 +Product: Mono: Compilers +Version: 1.1 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: compiler crash with anonymous methods + +The following sample makes mcs crash with: +Unhandled Exception: System.Exception: This should not happen: both Field +and Local are null +in <0x001b3> Mono.CSharp.LocalVariableReference:EmitAssign +(Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, Boolean +leave_copy, Boolean prepare_for_load) +in <0x0017c> Mono.CSharp.Assign:Emit (Mono.CSharp.EmitContext ec, Boolean +is_statement) +in <0x0000f> Mono.CSharp.Assign:EmitStatement (Mono.CSharp.EmitContext ec) +... + +using System; + +delegate void Do (); + +class T { + static void doit (int v) { + Console.WriteLine (v); + } + static void Main () { + Do[] arr = new Do [5]; + for (int i = 0; i < 5; ++i) { + arr [i] = delegate {doit (i);}; + } + for (int i = 0; i < 5; ++i) { + arr [i] (); + } + for (int i = 0; i < 5; ++i) { + arr [i] = delegate {doit (i);}; + } + } + +} + +The crash disappears when removing the last for loop. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
