[Mono-bugs] [Bug 69614][Nor] Changed - mcs crash when using anonymous delegate
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 20 Apr 2005 11:08:40 -0400 (EDT)
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 danw@novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=69614
--- shadow/69614 2005-04-19 21:42:06.000000000 -0400
+++ shadow/69614.tmp.10484 2005-04-20 11:08:40.000000000 -0400
@@ -1,13 +1,13 @@
Bug#: 69614
Product: Mono: Compilers
Version: 1.1
OS: unknown
OS Details:
-Status: RESOLVED
-Resolution: FIXED
+Status: REOPENED
+Resolution:
Severity: Unknown
Priority: Normal
Component: C#
AssignedTo: miguel@ximian.com
ReportedBy: danw@novell.com
QAContact: mono-bugs@ximian.com
@@ -80,6 +80,61 @@
------- Additional Comments From miguel@ximian.com 2005-04-19 21:42 -------
Fixed on SVN.
The parameter stuff was responsible for the second incarnation of the
bug.
+
+------- Additional Comments From danw@novell.com 2005-04-20 11:08 -------
+sigh. another slight tweak (changing the "if" to a "foreach" and
+using the foreach variable inside the delegate) makes it crash again:
+
+using System;
+
+class Delegable {
+ public event EventHandler MyDelegate;
+}
+
+class DelegateTest {
+ static void Main (string[] argv)
+ {
+ Console.WriteLine ("Test");
+
+ Delegable db = new Delegable ();
+ foreach (string arg in argv) {
+ db.MyDelegate += delegate (object o, EventArgs args) {
+ Console.WriteLine ("{0}", argv);
+ Console.WriteLine ("{0}", arg);
+ Console.WriteLine ("{0}", db);
+ };
+ }
+ }
+}
+
+
+and here's a slight variation that gives a different error:
+
+using System;
+
+class Delegable {
+ public event EventHandler MyDelegate;
+}
+
+class DelegateTest {
+ static void Main (string[] argv)
+ {
+ Delegable db;
+
+ foreach (string arg in argv) {
+ db = new Delegable ();
+ db.MyDelegate += delegate (object o, EventArgs args) {
+ Console.WriteLine ("{0} {1}", arg, argv);
+ };
+ }
+ }
+}
+
+
+Again, in the first example, removing *any* of the WriteLines makes
+the crash go away. In the second example, splitting the single
+WriteLine into two WriteLines makes the crash go away.
+