Bug 16013 – [REG2.072a] ICE with mutually dependent structs and alias this

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-10T22:01:47Z
Last change time
2017-10-15T14:32:16Z
Keywords
ice, pull
Assigned to
No Owner
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2016-05-10T22:01:47Z
This has two variants that trigger different ICEs. These are further reductions of issue 16012, but that one is no ICE, and these ICEs are more recent regressions. Both tests compile with dmd 2.071, and they fail with git master (bc74f4a). Variant 1 fails in statement.d, line 931. test1.d: ---- struct Impl { S _payload; } struct RefCounted { void opAssign(RefCounted rhs) {} void opAssign(S rhs) {} S refCountedPayload() { return S.init; } alias refCountedPayload this; } struct S { RefCounted s; } ---- Output of `dmd -c test1.d`: ---- [email protected](931): Assertion failure ---------------- ??:? _d_assert [0x6e4493] ??:? void ddmd.statement.__assert(int) [0x5f7074] ??:? ddmd.statement.ErrorStatement ddmd.statement.ErrorStatement.__ctor() [0x5e649c] ??:? _ZN12ExpStatement8semanticEP5Scope [0x5e6d4e] ??:? _ZN17CompoundStatement8semanticEP5Scope [0x5e7722] ??:? _ZN15FuncDeclaration9semantic3EP5Scope [0x5822b4] ??:? _ZN15FuncDeclaration9semantic3EP5Scope [0x58114c] ??:? _ZN20AggregateDeclaration9semantic3EP5Scope [0x4e0b2d] ??:? _ZN6Module9semantic3Ev [0x52fe51] ??:? int ddmd.mars.tryMain(ulong, const(char)**) [0x5af185] ??:? _Dmain [0x5afcae] ??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x6e64f6] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x6e6440] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x6e64b2] ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x6e6440] ??:? _d_run_main [0x6e63b1] ??:? main [0x5b0205] ??:? __libc_start_main [0x9c1a882f] ---- Variant 2 fails in glue.c, line 1519. test2.d: ---- S s; /* Only this line has changed from above. */ struct RefCounted { void opAssign(RefCounted rhs) {} void opAssign(S rhs) {} S refCountedPayload() { return S.init; } alias refCountedPayload this; } struct S { RefCounted s; } ---- Output of `dmd -c test2.d`: ---- dmd: glue.c:1519: unsigned int totym(Type*): Assertion `0' failed. Aborted (core dumped) ----
Comment #1 by k.hara.pg — 2016-05-13T20:59:46Z
Comment #2 by bugzilla — 2017-03-20T01:01:19Z
Comment #3 by bugzilla — 2017-10-08T06:50:47Z
https://github.com/dlang/dmd/pull/7197 is just the tests, and they appear to pass now.
Comment #4 by github-bugzilla — 2017-10-15T14:32:15Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/4d798345fb4b28e03acb42abec88366bf55fb4b3 fix Issue 16013 - [REG2.072a] ICE with mutually dependent structs and alias this https://github.com/dlang/dmd/commit/e2bf1e1d579a266e33f8e0217175462986bcf5a6 Merge pull request #7197 from WalterBright/fix16013 fix Issue 16013 - [REG2.072a] ICE with mutually dependent structs and…