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.