mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23:14 +01:00
[svn r84] Fixed: Returning from a void function from inside the try of a try-finally block was broken.
This commit is contained in:
@@ -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
11
test/bug45.d
Normal file
@@ -0,0 +1,11 @@
|
||||
module bug45;
|
||||
|
||||
void foo() {
|
||||
int bar;
|
||||
scope(exit) { bar++; }
|
||||
if (bar) return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
foo();
|
||||
}
|
||||
Reference in New Issue
Block a user