digitalmars.D.bugs - [Issue 7324] New: Access Violation when printing struct with union
- d-bugmail puremagic.com (37/37) Jan 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7324
- d-bugmail puremagic.com (11/11) Mar 25 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7324
http://d.puremagic.com/issues/show_bug.cgi?id=7324 Summary: Access Violation when printing struct with union Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: andrej.mitrovich gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-19 20:04:35 PST --- import std.stdio; struct JSONValue { union { string str; long integer; real floating; JSONValue[string] object; JSONValue[] array; } int type; } void main() { JSONValue foo; foo.str = "a"; // remove to avoid access violation JSONValue bar; bar.object["foo"] = foo; writeln(bar.object["foo"]); // object.Error: Access Violation } This is taken from std.json, which suffers from these segfaults when you try to print out the 'object' field. Using `foreach (key, val)` works fine though. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7324 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2012-03-25 03:18:02 PDT --- *** This issue has been marked as a duplicate of issue 7230 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 25 2012