Bug 2317 – asm offsetof generates: Internal error: ../ztc/cod3.c 2651

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2008-08-27T06:31:00Z
Last change time
2014-03-01T00:36:08Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
manuelk89

Comments

Comment #0 by manuelk89 — 2008-08-27T06:31:17Z
// file main.d struct Foo { // Use one of these lines at a time //float x; // OK float x,y; // ERROR //float[0] x; // OK //float[1] x; // OK //float[2] x; // ERROR //float[3] x; // ERROR //int x; // OK //int x,y; // ERROR //int[2] x; // ERROR //char x; // OK //char x,y; // OK !! //char[2] x; // OK !! //dchar x,y; // ERROR //dchar[2] x; // ERROR } void bar(Foo f) { asm { // bug seems to arise whenever 'offsetof f' is used mov EAX, offsetof f; } } --------------- $ dmd main.d Internal error: ../ztc/cod3.c 2651 This error seems to arise whenever the struct has more than one "field" (either as real variable field or even as array), but interestingly it works for char. 'f' has to be a parameter, it compiles fine when declared as a global or local var.
Comment #1 by snake.scaly — 2008-08-28T15:24:57Z
The error also arises in case of: char x,y,a,b,c; // ERROR real x; // ERROR That is, when Foo.sizeof > 4.
Comment #2 by bugzilla — 2008-08-29T00:30:39Z
Don't worry, I'll have that one fixed in the next update.
Comment #3 by bugzilla — 2008-09-03T01:38:12Z
Fixed dmd 1.035 and 2.019