mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-19 14:23:13 +01:00
[svn r83] Fixed: Returning a struct from within the try block of a try-finally was broken.
This commit is contained in:
@@ -96,7 +96,7 @@ void ReturnStatement::toIR(IRState* p)
|
||||
if (fin.empty())
|
||||
new llvm::ReturnInst(p->scopebb());
|
||||
else {
|
||||
new llvm::BranchInst(fin.back().bb);
|
||||
new llvm::BranchInst(fin.back().bb, p->scopebb());
|
||||
fin.back().ret = true;
|
||||
}
|
||||
delete e;
|
||||
|
||||
21
test/bug44.d
Normal file
21
test/bug44.d
Normal file
@@ -0,0 +1,21 @@
|
||||
module bug44;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct rgb
|
||||
{
|
||||
long l;
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
}
|
||||
|
||||
rgb test() {
|
||||
scope(exit) foo();
|
||||
return rgb();
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
rgb r = test();
|
||||
}
|
||||
Reference in New Issue
Block a user