[Issue 17287] [ICE] backend/cgcod.c 255: zero length static arrays

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Mar 30 15:02:17 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17287

--- Comment #5 from kinke at gmx.net ---
(In reply to Илья Ярошенко from comment #4)
> (In reply to hsteoh from comment #3)
> > I've used zero-length static arrays at the end of structs before, and they
> > work, for the most part.  I'm surprised having a zero-length member in the
> > middle of a struct causes an ICE, though. Or is it the zero-length ctor
> > parameter that's causing the problem?
> 
> It is all factors together. No one line can be removed to reduce this
> example.

We've had the same issue with LDC. Zero-length static arrays are so special
because they are the only type with a size of 0. Empty structs have a size of
1. If I recall correctly, we ended up ignoring zero-sized aggregate fields in
the backend and passing/returning them as byte (analogous to empty structs).

--


More information about the Digitalmars-d-bugs mailing list