Bug 17380 – Compiler segfaults on undefined symbol

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-05-07T11:04:30Z
Last change time
2018-10-10T23:00:58Z
Keywords
ice
Assigned to
No Owner
Creator
kai

Attachments

IDFilenameSummaryContent-TypeSize
1645bug.dSource file demonstrating the bug.text/plain7206

Comments

Comment #0 by kai — 2017-05-07T11:04:30Z
Created attachment 1645 Source file demonstrating the bug. Compiling the attached source with dmd -unittest -main bug.d, dmd segfaults. When line 88 is replaced by line 89 then it compiles and links. The culprit is an undefined symbol: Uint128 opCast(T : Uint128)() { return ThisTypeDoesNotExistsAndCrahesTheCompiler(v); } Changing to Uint128 opCast(T : Uint128)() { return Uint128(0); } dmd does not crash.
Comment #1 by ag0aep6g — 2017-05-07T11:32:01Z
(In reply to kai from comment #0) > Created attachment 1645 [details] > Source file demonstrating the bug. Reduced: ---- struct Int128 { Uint128 opCast() { return ThisTypeDoesNotExistsAndCrahesTheCompiler; } alias opCast this; } struct Uint128 { Int128 opCast() { return Int128.init; } alias opCast this; } ---- Neither this reduction nor the original code compile for me with dmd 2.073.2. So this doesn't seem like a regression in 2.074 to me.
Comment #2 by bugzilla — 2017-07-05T04:21:24Z
I don't think it is a regression, either. https://github.com/dlang/dmd/pull/6969
Comment #3 by github-bugzilla — 2017-07-05T21:46:12Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a583f97e3c99d91c499da6c3c3f22e810a5890d8 fix Issue 17380 - [REG 2.074.0] Compiler segfaults on undefined symbol https://github.com/dlang/dmd/commit/e0223539bbdd6e0aef749ba93435c9144635d5f6 Merge pull request #6969 from WalterBright/fix17380 fix Issue 17380 - Compiler segfaults on undefined symbol
Comment #4 by github-bugzilla — 2017-08-07T13:17:22Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a583f97e3c99d91c499da6c3c3f22e810a5890d8 fix Issue 17380 - [REG 2.074.0] Compiler segfaults on undefined symbol https://github.com/dlang/dmd/commit/e0223539bbdd6e0aef749ba93435c9144635d5f6 Merge pull request #6969 from WalterBright/fix17380
Comment #5 by github-bugzilla — 2017-08-16T13:23:25Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a583f97e3c99d91c499da6c3c3f22e810a5890d8 fix Issue 17380 - [REG 2.074.0] Compiler segfaults on undefined symbol https://github.com/dlang/dmd/commit/e0223539bbdd6e0aef749ba93435c9144635d5f6 Merge pull request #6969 from WalterBright/fix17380
Comment #6 by ibuclaw — 2018-10-10T23:00:19Z
*** Issue 6523 has been marked as a duplicate of this issue. ***
Comment #7 by ibuclaw — 2018-10-10T23:00:58Z
*** Issue 9327 has been marked as a duplicate of this issue. ***