Bug 12585 – Regression(2.064): Segfault on lazy/catch/opIndex

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-04-16T00:20:00Z
Last change time
2014-04-18T08:39:54Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
bus_dbugzilla

Comments

Comment #0 by bus_dbugzilla — 2014-04-16T00:20:43Z
This segfaults on 2.064 and newer (worked on 2.063.2): ----------------------------------- struct Bar { int opIndex(size_t index) { return 0; } } struct Foo { Bar opIndex(size_t index) { throw new Exception("Fail"); } } Foo foo() { return Foo(); } void catchStuff(E)(lazy E expression) { try expression(); catch(Exception e) {} } void main() { catchStuff(foo[0][0]); } ----------------------------------- On windows, adding dummy members to struct Foo leads to slightly different forms of crashing. Might be some sort of memory corruption.
Comment #1 by k.hara.pg — 2014-04-16T14:50:42Z
Comment #2 by k.hara.pg — 2014-04-16T15:42:35Z
Comment #3 by github-bugzilla — 2014-04-18T08:39:53Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/522f13c5613aa7a10f885086cfa7ef8d0f256f3d fix Issue 12585 - Segfault on lazy/catch/opIndex https://github.com/D-Programming-Language/dmd/commit/f4769781b449ea49d0522b3bc9aeea109a969872 Merge pull request #3464 from 9rnsr/fix12585 [REG2.064] Issue 12585 - Segfault on lazy/catch/opIndex