[Mono-bugs] [Bug 33533][Maj] New - Stack problem with params-arguments transfering value types

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
9 Nov 2002 17:53: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 mathias.hasselmann@gmx.de.

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

--- shadow/33533	Sat Nov  9 12:53:12 2002
+++ shadow/33533.tmp.29063	Sat Nov  9 12:53:12 2002
@@ -0,0 +1,43 @@
+Bug#: 33533
+Product: Mono/Runtime
+Version: unspecified
+OS: Red Hat 7.3
+OS Details: 2.4.20-pre10acpi20021002
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mathias.hasselmann@gmx.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Stack problem with params-arguments transfering value types
+
+Following code passing a variable number of value-type arguments to a
+method compiles with mcs-0.16 and mcs-anoncvs20021108 but failes to run
+with mono-0.16 and mono-anoncvs20021108:
+
+class TestCase
+{
+    public struct JValue 
+    { 
+        int val; 
+        public JValue(int i) { this.val = i; }
+	public static implicit operator JValue(int i) { return new JValue(i); }
+    }
+    static void TriggerTheBug(params JValue[] args) {}
+    public static void Main() { TriggerTheBug(new JValue(23)); }
+}
+
+instead of passing code to "TriggerTheBug" this error message followed by a
+NullReferenceException is exposed:
+
+** (testcase.exe:5023): WARNING **: more values on stack at 00
+.TestCase:Main () IL_001f: 1
+ (LDIND_I4 ADDR_L[1])
+
+This problem could be caused by bug 33532. Attached you'll find the binary
+produced by anoncvs version of mcs.