[svn r84] Fixed: Returning from a void function from inside the try of a try-finally block was broken.

This commit is contained in:
Tomas Lindquist Olsen
2007-10-31 22:35:39 +01:00
parent 44d2104eec
commit 947bba2b48
2 changed files with 12 additions and 1 deletions

View File

@@ -128,7 +128,7 @@ void ReturnStatement::toIR(IRState* p)
new llvm::ReturnInst(p->scopebb());
}
else {
new llvm::BranchInst(fin.back().bb);
new llvm::BranchInst(fin.back().bb, p->scopebb());
fin.back().ret = true;
}
}

11
test/bug45.d Normal file
View File

@@ -0,0 +1,11 @@
module bug45;
void foo() {
int bar;
scope(exit) { bar++; }
if (bar) return;
}
void main() {
foo();
}