[Issue 15126] New: [Reg 2.069-devel] dmd crashes when analyzing array literal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Sep 28 11:38:05 PDT 2015


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

          Issue ID: 15126
           Summary: [Reg 2.069-devel] dmd crashes when analyzing array
                    literal
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

cat > bug.d << CODE
struct Json
{
    ubyte[16] m_data;
    const(Json) opDispatch(string prop)() const { }
    Json opDispatch(string prop)() { }
}

template isCustomSerializable(T)
{
    enum isCustomSerializable = T.init.toRepresentation();
}

alias bug = isCustomSerializable!Json;
CODE

dmd -c bug
----

Crashes b/c some of the array literal expressions are null.
Might be an oversight of
https://github.com/D-Programming-Language/dmd/pull/5085.
This affects vibe.d.

----
Program received signal SIGSEGV, Segmentation fault.
0x0000000000541df8 in resolvePropertiesX(Scope*, Expression*, Expression*) ()
#0  0x0000000000541df8 in resolvePropertiesX(Scope*, Expression*, Expression*)
()
#1  0x0000000000542c7f in resolveProperties(Scope*, Expression*) ()
#2  0x0000000000544039 in arrayExpressionToCommonType(Scope*,
Array<Expression*>*, Type**) ()
#3  0x000000000054cf78 in ArrayLiteralExp::semantic(Scope*) ()
#4  0x0000000000543b1e in arrayExpressionSemantic(Array<Expression*>*, Scope*,
bool) ()
#5  0x000000000054da3c in StructLiteralExp::semantic(Scope*) ()
----

--


More information about the Digitalmars-d-bugs mailing list