http://d.puremagic.com/issues/show_bug.cgi?id=7965
Nils <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Nils <[email protected]> 2012-06-17 16:50:24 PDT --- Seems to me that the default initializer for nested structs misses the context pointer. --- void main() { int x; struct S { char y; void boom() {x = 42;} // makes the struct nested } S s; s.boom(); } --- There's no crash with an int y, probably because then the struct is considered to be "all zeros", and is given special treatment. It crashes anyway when y is explicitly initialized to 0, because the "all zeros" recognizer isn't that smart <https://github.com/D-Programming-Language/dmd/blob/aa7939aefcf61d6a44f2d4df15157427f7725fc0/src/struct.c#L532>. There's no crash if s is initialized to S() or {}. S.init.boom() crashes, too, of course. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
