[Mono-bugs] [Bug 52597][Wis] Changed - We generate invalid code for using idisposable structs

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 4 Jan 2004 23:53:22 -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 bmaurer@users.sf.net.

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

--- shadow/52597	2004-01-04 23:45:46.000000000 -0500
+++ shadow/52597.tmp.32005	2004-01-04 23:53:22.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 52597
 Product: Mono/Compilers
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -48,6 +48,34 @@
 
 MS generates:
 
       IL_0014:  ldloca.s   V_0
       IL_0016:  call       instance void Blah::Dispose()
       IL_001b:  endfinally
+
+------- Additional Comments From bmaurer@users.sf.net  2004-01-04 23:53 -------
+Related,
+
+using System;
+using System.Collections;
+
+struct Blah : IEnumerable {
+	IEnumerator IEnumerable.GetEnumerator () {
+		return null;
+	}
+}
+
+class B  {
+	static void Main () {
+		foreach (object o in new Blah ())
+			;
+	}
+}
+
+Makes the runtime freeze. It makes the MS runtime throw an
+ExecutionEngineExceptioon. The IL is invalid, again we treat it like a
+reference type.
+
+We need a few test cases 
+1) IDisposable struct -- regular impl, explicit impl
+2) IEnumerable struct -- regulare / explicit impl
+3) IEnumerable returning a strongly typed struct -- regular/explicit