Bug 10551 – [CTFE] Wrong-code on passing dereferenced array pointer by ref 2

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-05T10:23:00Z
Last change time
2015-06-09T05:11:35Z
Keywords
CTFE, wrong-code
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-07-05T10:23:12Z
Original testcase which was reduced to Issue 10243 still fails. Another reduced testcase: --- void f(ref ubyte n) { n = 1; } void g(ubyte* p) { f(p[0]); } void test() { ubyte[1] arr; //f(*arr.ptr); // now works g(arr.ptr); assert(arr == [1]); } void main() { test(); static assert((test(), true)); } ---
Comment #1 by bugzilla — 2013-07-09T12:16:34Z
Comment #2 by github-bugzilla — 2013-07-21T11:36:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d9a769ed0cbec4065306349077381e3e021498f3 Fix issue 10551 CTFE array pointer passed by ref IndexExp needs to consider the case where we need a reference https://github.com/D-Programming-Language/dmd/commit/97c624f73bc3b76cff8ae9f21c4dba2767f87cd6 Merge pull request #2324 from donc/ctfe10551_derefpointer Fix issue 10551 CTFE array pointer passed by ref
Comment #3 by github-bugzilla — 2013-09-13T10:46:05Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3686f3fc96f604676156e5f7e487ba1f89d9456b Fix issue 10551 CTFE array pointer passed by ref IndexExp needs to consider the case where we need a reference