[Mono-bugs] [Bug 43682][Nor] New - stobj miss-handled, causes crash.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 26 May 2003 17:17:32 -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 miguel@ximian.com.

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

--- shadow/43682	Mon May 26 17:17:32 2003
+++ shadow/43682.tmp.26942	Mon May 26 17:17:32 2003
@@ -0,0 +1,55 @@
+Bug#: 43682
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: stobj miss-handled, causes crash.
+
+The following program (requires CVS mcs to compile or CSC) crashes:
+
+public class Bug {
+	public static void Main () {
+		System.IntPtr [] arr = { new System.IntPtr () };
+	}
+}
+
+The code generated is:
+
+    .method public static 
+           default void Main()  cil managed 
+    {
+        // Method begins at RVA 0x20f4
+	.entrypoint
+	// Code size 31 (0x1f)
+	.maxstack 3
+	.locals init (
+		native int[]	V_0,
+		native int[]	V_1,
+		native int	V_2)
+	IL_0000: ldc.i4.1 
+	IL_0001: newarr [mscorlib]System.IntPtr
+	IL_0006: stloc.1 
+	IL_0007: ldloc.1 
+	IL_0008: ldc.i4.0 
+	IL_0009: ldelema [mscorlib]System.IntPtr
+	IL_000e: ldloca.s 2
+	IL_0010: initobj [mscorlib]System.IntPtr
+	IL_0016: ldloc.2 
+	IL_0017: stobj [mscorlib]System.IntPtr
+	IL_001c: ldloc.1 
+	IL_001d: stloc.0 
+	IL_001e: ret 
+    } // end of method Bug::default void Main() 
+
+Both CSC and MCs generate this code.  The problem is at line IL_0017