digitalmars.D.bugs - [Issue 9982] New: ICE on CTFE for pointer dereference
- d-bugmail puremagic.com (53/53) Apr 23 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
- d-bugmail puremagic.com (45/45) Apr 23 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
- d-bugmail puremagic.com (24/24) Jul 09 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
- d-bugmail puremagic.com (12/12) Aug 26 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
- d-bugmail puremagic.com (11/11) Aug 26 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
- d-bugmail puremagic.com (9/9) Sep 13 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
- d-bugmail puremagic.com (10/10) Sep 13 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9982
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Summary: ICE on CTFE for pointer dereference Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: CTFE, ice Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: monarchdodra gmail.com Assertion failure: 'dest->op == TOKstructliteral || dest->op == TOKarrayliteral || dest->op == TOKstring' on line 1604 in file 'ctfeexpr.c' and Error: cannot dereference invalid pointer *chunk //---------------- static struct S { } struct SS { S s2; //[1] this(S s1) { //S s2; //[2] emplace(&s2, s1); } } void emplace(S* chunk, S arg) { emplacePostblitter(*chunk, arg); //[3] *chunk = arg; //[4] } private void emplacePostblitter(ref S chunk, S arg) { chunk = arg; } enum s = S(); enum p = SS(s); //---------------- Getting two different errors: [3] : //Assertion failure: 'dest->op == TOKstructliteral || dest->op == TOKarrayliteral || dest->op == TOKstring' on line 1604 in file 'ctfeexpr.c' If we comment [3], then it is [4] that errors: [4] Error: cannot dereference invalid pointer *chunk Interesting enough, if we move line [1] to line [2], then everything works fine. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 23 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Igor Stepanov <wazar.leollone yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wazar.leollone yahoo.com 07:03:08 PDT --- I've tried to simplify this bug case. My resolution: error in operation of taking address of struct member and dereference it. We must ask Don about this. struct Foo(T) { T a; this(T arg) { T* p = &a; *p = arg; } this(T arg, int) { T* p = &a; setRef(*p, arg); } static void setRef(ref T p, T v) { p = v; } } auto ct1 = Foo!int(99); //compiled, but doesn't set this.a to 99 auto ct2 = Foo!int(99, 0); //compiled, but doesn't set this.a to 99 //try with struct struct Bar { int b; } auto ct1_2 = Foo!Bar(Bar(99)); //Error auto ct2_2 = Foo!Bar(Bar(99), 0); //ICE void main() { assert(ct1.a != 99); assert(ct2.a != 99); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 23 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|D2 |D1 & D2 Severity|normal |critical This is a critical bug. Assignment via a pointer to a struct member does not work! struct Bug9982 { int a; } int test9982() { Bug9982 x; int *q = &x.a; *q = 99; assert(x.a == 99); return 1; } static assert(test9982()); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 09 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/72b160b53662feeb927175260f9e1b165b86009a Issue 9982 case(b) wrong code for dotvar pointer assign The existing code was complicated and just plain wrong. https://github.com/D-Programming-Language/dmd/commit/16c3d57ee460f368337bbd3f2dea39a1ff6e1903 Fix issue 9982 ICE on CTFE for pointer dereference CTFE assignments can resolve to a StructLiteral inplace assign. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 26 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla digitalmars.com Version|D1 & D2 |D1 23:56:53 PDT --- Fixed for D2. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 26 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0e7de354e055464634565f22bc764c9695b0475a Issue 9982 case(b) wrong code for dotvar pointer assign The existing code was complicated and just plain wrong. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 13 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9982 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Version|D1 |D1 & D2 Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 13 2013