D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.

Issue 7789

Summary: [CTFE] null pointer exception on setting array length
Product: D Reporter: Martin Nowak <code>
Component: dmdAssignee: No Owner <nobody>
Status: RESOLVED FIXED
Severity: normal CC: bugzilla
Priority: P2
Version: D2
Hardware: All
OS: All

Description Martin Nowak 2012年03月28日 11:22:41 UTC
cat > bug.d << CODE
struct S
{
 size_t foo()
 {
 _ary.length += 1;
 return _ary.length;
 }
 int[] _ary;
}
enum len = S().foo();
CODE
dmd -c bug
--------
Happens only if array is a struct field and when
read-assign on length (pre/post-increment or opAssign).
Comment 1 github-bugzilla 2012年03月28日 16:15:56 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/e9b87a059a3291927c6d9f65a8c748996e59b01b
Fix issue 7789 [CTFE] null pointer exception on setting array length
https://github.com/D-Programming-Language/dmd/commit/b79b3f8a54daceed0e4c7519d6822a453f2ef7ba
Merge pull request #845 from donc/ctfe7789
Fix issue 7789 [CTFE] null pointer exception on setting array length

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