[Issue 19413] Segfault assigning hashmap from slice in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 22 13:00:53 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19413

dlang at ryanjframe.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #3 from dlang at ryanjframe.com ---
I'm sorry; I'd removed a writeln on run.dlang.io before posting it here but
didn't test it. The writeln isn't necessary when I run it locally.

---
import std.stdio;

void main() { enum a = d(); writeln(a); }

auto d() {
    alias VP = string[string];
    VP[string] values;
    string str = "aaaaaa";
    values[str]["s"] = "val";

    str = str[1..3];
    values[str]["s"] = "val"; // <-- right here.

    return values;
}
---

--


More information about the Digitalmars-d-bugs mailing list