← Back to index
|
Original Bugzilla link
Bug 7876 – [CTFE] assertion failure on invalid stack reference
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-09T10:17:00Z
Last change time
2015-06-09T05:10:41Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0
by timon.gehr — 2012-04-09T10:17:14Z
DMD 2.058/2.059head: int* bar(){int x;auto ptr = &x;return ptr;} static assert({*bar()=2;return 1;}()); dmd: interpret.c:103: void CtfeStack::setValue(VarDeclaration*, Expression*): Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()' failed.
Comment #1
by github-bugzilla — 2012-08-22T10:04:26Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/71e616bdc12fc6abb9a5b5f5d3c4db894e95b0df
Fix issue 7876 [CTFE] assertion failure on invalid stack reference Generate an error when returning a pointer to a local variable. Includes the case where the pointer is a member of an array or struct.
https://github.com/D-Programming-Language/dmd/commit/cdd8d78136099ed49b0b330aaad17e041bb87dd7
Merge pull request #1092 from donc/7887pointertostack Fix issue 7876 [CTFE] assertion failure on invalid stack reference