Bug 21438 – Compiler segfault on static array in a struct at CTFE
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-11-30T15:20:40Z
Last change time
2021-10-21T21:39:22Z
Keywords
CTFE, ice, ice-on-valid-code, pull
Assigned to
No Owner
Creator
Max Samukha
Comments
Comment #0 by maxsamukha — 2020-11-30T15:20:40Z
dmd segfaults when compiling this code:
int genGBPLookup() {
static struct Table {
int[1] entries;
}
auto table = new Table;
auto x = table.entries[0];
return 0;
}
enum x = genGBPLookup;
void main() {
}
Comment #1 by moonlightsentinel — 2020-12-01T10:54:35Z
This is a regression:
Up to 2.066.0: Success and no output
Since 2.067.1: Segfault and no output
Introduced in this PR: https://github.com/dlang/dmd/pull/4227
Comment #2 by dlang-bot — 2021-10-17T18:46:45Z
@BorisCarvajal created dlang/dmd pull request #13188 "Fix Issue 21438 - Compiler segfault on static array in a struct at CTFE" fixing this issue:
- Fix Issue 21438 - Compiler segfault on static array in a struct at CTFE
https://github.com/dlang/dmd/pull/13188
Comment #3 by dlang-bot — 2021-10-17T22:05:54Z
dlang/dmd pull request #13188 "Fix Issue 21438 - Compiler segfault on static array in a struct at CTFE" was merged into stable:
- 374b0a5e2d99ed8d6151c94dc598f93db7f5e1db by Boris Carvajal:
Fix Issue 21438 - Compiler segfault on static array in a struct at CTFE
https://github.com/dlang/dmd/pull/13188
Comment #4 by dlang-bot — 2021-10-21T21:39:22Z
dlang/dmd pull request #13209 "Merge stable into master" was merged into master:
- b99421c6e05a465d39056504a4c5102bdc379bf5 by Boris Carvajal:
Fix Issue 21438 - Compiler segfault on static array in a struct at CTFE
https://github.com/dlang/dmd/pull/13209