[Mono-bugs] [Bug 70984][Cos] New - NullReference exception from mcs when cyclic stuct definition to itself

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 4 Jan 2005 11:05:45 -0500 (EST)


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 nazgul@omega.pl.

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

--- shadow/70984	2005-01-04 11:05:45.000000000 -0500
+++ shadow/70984.tmp.23547	2005-01-04 11:05:45.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 70984
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: nazgul@omega.pl               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullReference exception from mcs when cyclic stuct definition to itself
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem: 
+Error message for CS0523 is reported, but then mcs crashes
+
+
+Steps to reproduce the problem:
+1. Compile program:
+struct S1 {
+  public S1 x;
+}
+
+
+Actual Results:
+t.cs(42) error CS0523: Struct member `S1.x' causes a cycle in the structure
+layout
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00146> Mono.CSharp.TypeManager:CheckStructCycles
+(Mono.CSharp.TypeContainer,System.Collections.Hashtable,System.Collections.Hashtable)
+in <0x0002f> Mono.CSharp.TypeManager:CheckStructCycles
+(Mono.CSharp.TypeContainer,System.Collections.Hashtable)
+in <0x00a0f> Mono.CSharp.RootContext:PopulateTypes ()
+in <0x00c32> Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000f> Mono.CSharp.Driver:Main (string[])
+
+
+Expected Results:
+t.cs(42) error CS0523: Struct member `S1.x' causes a cycle in the structure
+layout
+
+
+How often does this happen? 
+Always
+
+Additional Information:
+Mono C# compiler version 1.1.3.0