Bug 19890 – ICE: Segmentation fault with negative array size
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-05-21T18:31:26Z
Last change time
2019-06-09T14:09:30Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2019-05-21T18:31:26Z
void[] f = cast(void[-1]) "a";
Comment #1 by ibuclaw — 2019-05-21T19:31:01Z
And adjusting the size of the static array instead causes a memory allocation failed ICE. Meaning that the first test triggers an integer overflow.
void[] f = cast(void[-2]) "a";
Comment #2 by ibuclaw — 2019-05-21T19:38:50Z
Casting to void[uint.max] causes a segmentation fault in another part of the compiler.
void[] f = cast(void[uint.max]) "a";
Comment #3 by ibuclaw — 2019-05-21T19:42:11Z
Casting to void[int.max] causes the backend to run out of memory.
void[] f = cast(void[int.max]) "a";
Comment #4 by dlang-bot — 2019-05-22T20:31:38Z
@ibuclaw created dlang/dmd pull request #9840 "fix Issue 19890 - ICE: Segmentation fault with negative array size" fixing this issue:
- fix Issue 19890 - ICE: Segmentation fault with negative array size
https://github.com/dlang/dmd/pull/9840
Comment #5 by dlang-bot — 2019-05-24T00:14:52Z
dlang/dmd pull request #9840 "fix Issue 19890 - ICE: Segmentation fault with negative array size" was merged into master:
- fb7814cc95e504503f6d6f94f3fc4ed2b73715b7 by Iain Buclaw:
fix Issue 19890 - ICE: Segmentation fault with negative array size
https://github.com/dlang/dmd/pull/9840
Comment #6 by dlang-bot — 2019-06-09T14:09:30Z
dlang/dmd pull request #10007 "[dmd-cxx] fix Issue 19890 - ICE: Segmentation fault with negative array size" was merged into dmd-cxx:
- 789cf579d506e3b021d9beb47bf43b36bdb629d8 by Iain Buclaw:
fix Issue 19890 - ICE: Segmentation fault with negative array size
https://github.com/dlang/dmd/pull/10007