Created attachment 1052 [details] The output of the compiled program When I compiled the following code with DMD v2.057 with -inline option, the compiled program aborts in runtime (on Linux 64bit). When I use regex("h") or regex(" ") instead of regex(" "), this code works correctly. issue.d: ---------------------------------------------------- import std.regex; import std.stdio; void main() { foreach(w; splitter("hoge fuga", regex(" "))) { writeln(w); writeln(w.length); } } ---------------------------------------------------- I attached the output of the compiled program.
This problem does not occurs in Windows 7 64bit. Output is: ---- hoge fuga 9 ----
Can't reproduce with 2.059 on Fedora x86_64. I tried: dmd x.d dmd -inline -O x.d dmd -m64 -inline -O x.d dmd -m64 -inline x.d All work. It's either a problem with your specific setup or it was fixed somewhere between 2.057-2.059.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/33f2ab82bd9fb51d88927b8048d88c30ea44111e Remove code for bug 7107 and 10296 because they are unnecessary anymore. Now instantiated symbols can reach correct "parent" via `Dsymbol::toParent2()`, because `TemplateInstance::enclosing` is properly calculated in `TemplateInstance::hasNestedArgs`.