6386 – [CTFE] ICE on pointer casting

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6386 - [CTFE] ICE on pointer casting
Summary: [CTFE] ICE on pointer casting
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2011年07月26日 12:01 UTC by kennytm
Modified: 2011年07月31日 12:09 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description kennytm 2011年07月26日 12:01:27 UTC
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
--------------------------------


AltStyle によって変換されたページ (->オリジナル) /