[Mono-bugs] [Bug 75042][Nor] Changed - Struct ctor does not 0 init
return value
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed May 25 14:06:19 EDT 2005
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 bmaurer at users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=75042
--- shadow/75042 2005-05-25 14:01:59.000000000 -0400
+++ shadow/75042.tmp.29018 2005-05-25 14:06:19.000000000 -0400
@@ -11,13 +11,13 @@
AssignedTo: mono-bugs at ximian.com
ReportedBy: nazgul at omega.pl
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
URL:
Cc:
-Summary: Runtime see nonnull value in notinitialized struct field
+Summary: Struct ctor does not 0 init return value
Please fill in this template when reporting a bug, unless you know what you
are doing.
Description of Problem:
The attached program (out.exe) comes from following Nemerle source code
(just for reference).
@@ -83,6 +83,20 @@
------- Additional Comments From bmaurer at users.sf.net 2005-05-25 14:01 -------
This is a better, IL only, test case.
On mono it gets a SIGTRAP, on .net it runs fine.
I believe the issue is the calling of the ctor for the value type.
+
+------- Additional Comments From bmaurer at users.sf.net 2005-05-25 14:06 -------
+The issue is the code generated for the ctor
+
+00000000 <xxx__ctor>:
+ 0: 55 push ebp
+ 1: 8b ec mov ebp,esp
+ 3: c9 leave
+ 4: c3 ret
+
+In C#, the def assignment rules are applied to the ctor -- that is,
+all fields of the struct must be assigned a value before control
+returns from the value type ctor. Thus, we would never have noticed if
+the runtime does not 0 init the fields of a struct
More information about the mono-bugs
mailing list