[Issue 18305] New: SysTime crashes ctfe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 26 16:03:07 UTC 2018


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

          Issue ID: 18305
           Summary: SysTime crashes ctfe
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

Steps to reproduce:

void main() { mixin({ return (SysTime.init is SysTime.init) ? "" : ""; }()); }

Expected:

nothing happens

Outcome:

Compiler crashes.

Observation:

I added some logging, and

test.d(5) BinExp::interpretCompareCommon() SysTime(0L, Rebindable(null, )) is
SysTime(0L, Rebindable(null, ))
ctfeIdentity op = 'TOKidentity', e1 = SysTime(0L, Rebindable(null, void)), e2 =
SysTime(0L, Rebindable(null, void))
test.d(5): Error: CTFE internal error: bad compare of void and void
core.exception.AssertError at ddmd/ctfeexpr.d(1345): Assertion failure

It looks like the second field in RebindableCommon's union ends up
void-initialized, and CTFE can't figure out how to compare that.

--


More information about the Digitalmars-d-bugs mailing list