← Back to index
|
Original Bugzilla link
Bug 6386 – [CTFE] ICE on pointer casting
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-26T12:01:00Z
Last change time
2011-07-31T12:09:15Z
Keywords
ice-on-invalid-code
Assigned to
nobody
Creator
kennytm
Comments
Comment #0
by kennytm — 2011-07-26T12:01:27Z
Test case: -------------------------------- static assert({ int x = 123; int* p = &x; float* q = cast(float*)p; // <-- unsafe pointer cast return *q; }()); -------------------------------- y.d(2): Error: CTFE internal error: illegal pointer value cast(float*)123u Assertion failed: (isStackValueValid(newval)), function createStackValue, file interpret.c, line 4998. Abort trap: 6 --------------------------------
Comment #1
by bugzilla — 2011-07-31T12:09:15Z
https://github.com/D-Programming-Language/dmd/commit/7ef3b2bb9e740df39108957ae5e3b2aa8253d351
https://github.com/D-Programming-Language/dmd/pull/284