Bug 925 – ICE on casting array literal to void[]

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-02-03T04:09:00Z
Last change time
2014-02-16T15:24:06Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2007-02-03T04:09:51Z
Probably related to Issue 720 in some way, as it's the same error: "Internal error: ..\ztc\cod1.c 2526". void main() { cast(void[])[1]; }
Comment #1 by thomas-dloop — 2007-04-05T11:33:30Z
Comment #2 by bugs-d — 2009-03-30T00:49:11Z
This test now passes with DMD 1.041 and 2.026. -[Unknown]
Comment #3 by robert — 2009-11-07T08:01:58Z
This test case is failing in dmd 1.051. The ICE has gone, but the result at runtime is incorrect. ---- module dstress.run.b.bug_cod1_2528_C; int main(){ auto x = cast(void[])[1]; return x.length - 1; } ---- Returns 3 instead of 0.
Comment #4 by clugdbug — 2009-11-13T04:12:15Z
The DStress test case is incorrect. The arrray literal is an int, so it's 4 bytes. Casting it to void[] should give a length of 4 -- and that's exactly what it does.