[Mono-bugs] [Bug 78776][Wis] New - Unexpected NullReferenceException with structs
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Jul 6 14:26:07 EDT 2006
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 jonpryor at vt.edu.
http://bugzilla.ximian.com/show_bug.cgi?id=78776
--- shadow/78776 2006-07-06 14:26:07.000000000 -0400
+++ shadow/78776.tmp.25330 2006-07-06 14:26:07.000000000 -0400
@@ -0,0 +1,72 @@
+Bug#: 78776
+Product: Mono: Runtime
+Version: 1.1
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: JIT
+AssignedTo: lupus at ximian.com
+ReportedBy: jonpryor at vt.edu
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Unexpected NullReferenceException with structs
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Tested with Mono 1.1.13.7.
+
+The attached program generates a NullReferenceException when invoking
+static methods of a struct.
+
+Steps to reproduce the problem:
+1. Compile and run dzoe.cs:
+
+mcs -debug+ dzoe.cs
+mono --debug dzoe.exe
+
+Actual Results:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in [0x0000d] (at
+/tmp/scratch/BUILD/mono-1.1.13.2/mcs/class/corlib/System/String.cs:1779)
+System.String:memcpy4 (System.Byte* dest, System.Byte* src, Int32 size)
+in [0x0009f] (at
+/tmp/scratch/BUILD/mono-1.1.13.2/mcs/class/corlib/System/String.cs:1870)
+System.String:memcpy (System.Byte* dest, System.Byte* src, Int32 size)in
+[0x00001] (at /export/home/pryorj/tmp/dzoe.cs:71) Test+Face:get_BoundingBox ()
+in [0x00072] (at /export/home/pryorj/tmp/dzoe.cs:84) Test:Main
+(System.String[] args)
+
+
+Expected Results:
+
+Test+Box
+
+How often does this happen?
+
+Always.
+
+
+Additional Information:
+
+- Changing the `struct Face' into a `class Face' removes the
+NullReferenceException.
+
+- Changing Test.Face.get_BoundingBox from this:
+
+ Vector pos = Vector.Min(u, Vector.Min(v, w));
+
+to this:
+
+ Vector temp = Vector.Min(v,w);
+ Vector pos = Vector.Min(u, temp);
+
+removes the NullReferenceException.
More information about the mono-bugs
mailing list