digitalmars.D.bugs - [Issue 11909] New: Struct members and static arrays break pure function escape analysis (immutability violation)
- d-bugmail puremagic.com (57/57) Jan 12 2014 https://d.puremagic.com/issues/show_bug.cgi?id=11909
- d-bugmail puremagic.com (11/11) Jan 12 2014 https://d.puremagic.com/issues/show_bug.cgi?id=11909
- d-bugmail puremagic.com (6/6) Jan 12 2014 https://d.puremagic.com/issues/show_bug.cgi?id=11909
- d-bugmail puremagic.com (9/9) Jan 26 2014 https://d.puremagic.com/issues/show_bug.cgi?id=11909
https://d.puremagic.com/issues/show_bug.cgi?id=11909 Summary: Struct members and static arrays break pure function escape analysis (immutability violation) Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid Severity: critical Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: code klickverbot.at PST --- The following two programs should not compile (reduced from http://forum.dlang.org/post/mailman.327.1389464975.15871.digitalmars-d puremagic.com): --- struct Data { char[256] buffer; property const(char)[] filename() const pure { return buffer[]; } } void test1() { Data d; string f = d.filename; d.buffer[0] = 'a'; } struct Data2 { char buffer; } --- --- property const(char)[] filename(const ref Data2 d) pure nothrow { return (&d.buffer)[0 .. 1]; } property const(char)[] filename2(const Data2* d) pure nothrow { return (&d.buffer)[0 .. 1]; } void test2() { Data2 d; string f = d.filename; string g = (&d).filename2; d.buffer = 'a'; } --- Similar to issue 11503. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 12 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11909 David Nadlinger <code klickverbot.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull PST --- (Note: Even though issue 11503 has a bounty on it, this was the bug that originally led to it.) -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 12 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11909 PST --- https://github.com/D-Programming-Language/dmd/pull/3085 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 12 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11909 David Nadlinger <code klickverbot.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 26 2014