[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:10:37 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:06:19.000000000 -0400
+++ shadow/75042.tmp.29095	2005-05-25 14:10:37.000000000 -0400
@@ -97,6 +97,17 @@
    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
+
+------- Additional Comments From bmaurer at users.sf.net  2005-05-25 14:10 -------
+FYI, we never end up noticing this in C# land because we always write:
+
+        IL_0000:  ldloca.s 0
+        IL_0002:  initobj X
+
+Interestingly, the IL encoding used by nemerle is actually shorter
+than the one mcs uses. Am suprised that this is the case. Today, the
+initobj version is probably much faster speed-wise (it is inlined...)
+however.


More information about the mono-bugs mailing list