[Mono-bugs] [Bug 25969] New - SingletonStruct and struct size of zero

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
7 Jun 2002 19:04:52 -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 manyoso@yahoo.com.

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

--- shadow/25969	Fri Jun  7 15:04:52 2002
+++ shadow/25969.tmp.11750	Fri Jun  7 15:04:52 2002
@@ -0,0 +1,46 @@
+Bug#: 25969
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: manyoso@yahoo.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SingletonStruct and struct size of zero
+
+using System; 
+public struct SingletonStruct { 
+private static readonly SingletonStruct instance = new SingletonStruct (null); 
+private SingletonStruct (Object dummy) {} 
+public static SingletonStruct Instance { 
+get {return instance;} 
+} 
+} 
+ 
+and: 
+ 
+using System; 
+public class SingletonTest { 
+public SingletonTest (SingletonStruct dummy) 
+{ 
+Console.WriteLine ("Test passed!"); 
+} 
+public static void Main (String[] args) 
+{ 
+SingletonTest test = new SingletonTest (SingletonStruct.Instance); 
+} 
+} 
+compile that with csc and mono will run it just fine, but compile with mcs and mono reports: 
+ 
+(process:775): ** WARNING **: unhandled exception System.ExecutionEngineException: "file 
+codegen-x86.c: line 5811 (mono_burg_emit_256): assertion failed: (size > 0)" 
+TODO: implement stack traces 
+RESULT: -1