[Issue 7175] Zero-length static array .ptr is always null

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Sep 15 00:23:17 PDT 2014


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

--- Comment #6 from github-bugzilla at puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b7866eff1567e5dfdf0e28e99d6cb3515d273854
Fix bogus zero-length array test.

Issue 7175 was about .ptr always giving null for a zero-length
static array in a struct, despite the fact that the struct has
size 1 and thus certainly a non-null address.

The test case as modified by 36c9b64, however, checks that a
free-standing zero-length static array on the stack has an
address, which is quite a different scenario. From the spec,
I don't see a reason why zero-sized objects should need any
memory associated with them, so I am reluctant to pessimize
LDC's codegen over this.

--


More information about the Digitalmars-d-bugs mailing list