www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7230] New: Crash during printing anonymous union with writeln family functions.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230

           Summary: Crash during printing anonymous union with writeln
                    family functions.
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: luk.wrzosek gmail.com


--- Comment #0 from Lukasz Wrzosek <luk.wrzosek gmail.com> 2012-01-05 02:28:54
PST ---
writeln is not aware of anonymous unions inside of structs (probably classes
too).

The attached file crashes when run.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230



--- Comment #1 from Lukasz Wrzosek <luk.wrzosek gmail.com> 2012-01-05 02:30:33
PST ---
Created an attachment (id=1068)
bug test case

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #2 from bearophile_hugs eml.cc 2012-01-05 02:38:21 PST ---
Code copied here to increase its visibility:


import std.stdio;
struct Bug7230 {
    union {
        string a;
        int b;
    }
}
void main() {
    Bug7230 bug;
    bug.b = 123;
    writeln(bug);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #3 from Kenji Hara <k.hara.pg gmail.com> 2012-01-06 12:36:45 PST ---
https://github.com/D-Programming-Language/phobos/pull/383

The format implemented the patch is not yet determined.
Please comment your opinion.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 06 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230



--- Comment #4 from bearophile_hugs eml.cc 2012-01-06 13:31:11 PST ---
(In reply to comment #3)
 https://github.com/D-Programming-Language/phobos/pull/383
 
 The format implemented the patch is not yet determined.
 Please comment your opinion.
Thank you for improving writeln. Maybe the string tag "union" is better than "overlap": Bug7230("hello", #{union a, b, c}, 10) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 06 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #5 from Kenji Hara <k.hara.pg gmail.com> 2012-02-10 06:30:36 PST ---
https://github.com/D-Programming-Language/phobos/commit/1d2962b4a19dbd40ab6269539bb3382ed0b9f6c5

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7230


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #6 from Kenji Hara <k.hara.pg gmail.com> 2012-03-25 03:18:02 PDT ---
*** Issue 7324 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 25 2012