[Mono-bugs] [Bug 36030][Nor] New - Weird array access problem when mixed with conversion to void * etc

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
21 Dec 2002 21:37:13 -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 ravi@ximian.com.

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

--- shadow/36030	Sat Dec 21 16:37:13 2002
+++ shadow/36030.tmp.2220	Sat Dec 21 16:37:13 2002
@@ -0,0 +1,44 @@
+Bug#: 36030
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: ravi@ximian.com                            
+ReportedBy: ravi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Weird array access problem when mixed with conversion to void * etc
+
+The following program produces a stack underflow in the code generated by MCS:
+
+using System;
+
+namespace IntPtr_Conv
+{
+        struct FooStruct {
+                int x;
+        }
+
+        class Class1 {
+                
+                static int Main(string[] args)
+                {
+                        IntPtr[] pArray = new IntPtr[1] {IntPtr.Zero};
+
+                        unsafe {
+                                FooStruct* s = (FooStruct*) (pArray[0]);
+                        }
+
+                        return 0;
+                }
+        }
+}
+
+It seems like there is some bug in the array access code. Happens everytime