[Mono-bugs] [Bug 21801] New - mcs creates invalid code with "new ValueType()" and assignement to array element
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
12 Mar 2002 12:46:12 -0000
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 lupus@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=21801
--- shadow/21801 Tue Mar 12 07:46:12 2002
+++ shadow/21801.tmp.28895 Tue Mar 12 07:46:12 2002
@@ -0,0 +1,41 @@
+Bug#: 21801
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: lupus@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs creates invalid code with "new ValueType()" and assignement to array element
+
+The test case is mono/tests/string-compare.cs.
+We have a valuetype (datum) and in Main we create an array of datun:
+datum[] data = {new datum(args)};
+
+Here, csc does:
+ldloc data
+ldc.i4 0
+ldelema
+load args
+newobj...
+stobj
+
+while mcs uses an additional datum local var, but gets the eval stack wrong:
+ldloc data
+ldc.i4 0
+ldloca tmp_datum
+load args
+newobj...
+ldloc tmp_datum
+stobj
+
+(After newobj there is obj, int, valuetype on the stacl, while stobj
+requires address, valuetype).