Bug 17632 – [REG 2.075-b1] opBinary and delegate code generation

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-07-10T18:38:59Z
Last change time
2017-08-15T22:06:18Z
Keywords
ice, wrong-code
Assigned to
No Owner
Creator
briancschott
See also
https://issues.dlang.org/show_bug.cgi?id=17622

Comments

Comment #0 by briancschott — 2017-07-10T18:38:59Z
The following code executes successfully with 2.074.1 but segmentation faults with 2.075.0-b4: ---------------------------------------------------- import std.stdio; struct Test { void delegate() testBody; Exception unexpected; void opBinary(string op)(void delegate() fun) { testBody = fun; // Call it try testBody(); catch (Exception ex) unexpected = ex; } } struct URL { string fragment; } struct JsonCube { URL dataURL; } struct JsonCubeDef { JsonCube _def; this(string) { } } immutable TEST_JSON = `{}`; void main() { auto def = cast(immutable) JsonCubeDef(TEST_JSON); Test() in { writeln(def); }; }
Comment #1 by dlang-bugzilla — 2017-07-10T19:44:41Z
Comment #2 by code — 2017-07-14T13:05:51Z
We'll address this with 2.075.1 to not delay the release even further.
Comment #3 by bugzilla — 2017-08-02T09:03:05Z
I cannot reproduce this. What switches are used? Anyhow, it appears to be the same issue as 17622.
Comment #4 by briancschott — 2017-08-02T09:20:39Z
I don't have to pass any switches to cause this behavior: $ which rdmd /home/brian/.dvm/compilers/dmd-2.075.0/linux/bin/rdmd $ rdmd test.d Segmentation fault Running on 64-bit Linux.
Comment #5 by code — 2017-08-03T17:05:56Z
*** This issue has been marked as a duplicate of issue 17622 ***
Comment #6 by briancschott — 2017-08-15T22:06:18Z
I can confirm that this bug no longer happens in Emsi's code with 2.075.1.