Bug 23529 – [ICE] Compiler segfaults on static array cast
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-12-01T03:18:23Z
Last change time
2022-12-15T22:50:03Z
Keywords
pull
Assigned to
uplink.coder
Creator
uplink.coder
Comments
Comment #0 by uplink.coder — 2022-12-01T03:18:23Z
Currently the compiler will segfault because of an internal null pointer which is not checked against.
static assert(!__traits(compiles, ()
{
char[24] x;
int myNumber = 4;
return cast(char[4]) (x[myNumber .. myNumber + 4]);
} ()));
Comment #1 by dlang-bot — 2022-12-01T03:28:30Z
@UplinkCoder created dlang/dmd pull request #14660 "Fix Issue 23529 - Segfault on static array cast with non-const expres…" fixing this issue:
- Fix Issue 23529 - Segfault on static array cast with non-const expressions
https://github.com/dlang/dmd/pull/14660
Comment #2 by dlang-bot — 2022-12-01T09:26:31Z
dlang/dmd pull request #14660 "Fix Issue 23529 - Segfault on static array cast with non-const expres…" was merged into stable:
- 7b968d48fe3e9e274464a6c360ad23c47347f518 by Stefan Koch:
Fix Issue 23529 - Segfault on static array cast with non-const expressions
https://github.com/dlang/dmd/pull/14660
Comment #3 by dlang-bot — 2022-12-15T22:50:03Z
dlang/dmd pull request #14701 "merge stable" was merged into master:
- 9fe6e029b11f4281b2b9949acc3dc476799bd4d4 by Stefan Koch:
Fix Issue 23529 - Segfault on static array cast with non-const expressions (#14660)
https://github.com/dlang/dmd/pull/14701