[Issue 13968] New: [REG2.067a] constructing and returing union causes segfault

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 11 19:21:51 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13968

          Issue ID: 13968
           Summary: [REG2.067a] constructing and returing union causes
                    segfault
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: sinkuupump at gmail.com

Compiler segfaults without error messages.

Code:

union U
{
    bool a;
    long b;
}

U test1()
{
    return U();
}

U* test2()
{
    return new U();
}


Stack trace (with test1):

#0  0x00000000004a5231 in checkEscape(Scope*,
Expression*)::EscapeVisitor::visit(StructLiteralExp*) ()
#1  0x00000000004a5b93 in checkEscape(Scope*, Expression*) ()
#2  0x00000000004f6b00 in FuncDeclaration::semantic3(Scope*) ()
#3  0x0000000000407900 in Module::semantic3() ()
#4  0x0000000000404e8c in tryMain(unsigned long, char const**) ()
#5  0x00007ffff6e36ad5 in __libc_start_main () from /lib64/libc.so.6
#6  0x0000000000402c25 in _start ()


Stack trace (with test2):

#0  0x00000000004a5ad1 in checkEscape(Scope*,
Expression*)::EscapeVisitor::visit(NewExp*)
    ()
#1  0x00000000004a5b93 in checkEscape(Scope*, Expression*) ()
#2  0x00000000004f6b00 in FuncDeclaration::semantic3(Scope*) ()
#3  0x0000000000407900 in Module::semantic3() ()
#4  0x0000000000404e8c in tryMain(unsigned long, char const**) ()
#5  0x00007ffff6e36ad5 in __libc_start_main () from /lib64/libc.so.6
#6  0x0000000000402c25 in _start ()

--


More information about the Digitalmars-d-bugs mailing list