[svn r84] Fixed: Returning from a void function from inside the try of a try-finally block was broken.
author |
lindquist |
date |
Wed, 31 Oct 2007 22:35:39 +0100 |
parents |
875617f89c51 |
children |
3587401b6eeb |
files |
gen/statements.c test/bug45.d |
diffstat |
2 files changed, 12 insertions(+), 1 deletions(-)
[+]
|
line diff
--- a/gen/statements.c Wed Oct 31 22:20:19 2007 +0100
+++ b/gen/statements.c Wed Oct 31 22:35:39 2007 +0100
@@ -128,7 +128,7 @@
new llvm::ReturnInst(p->scopebb());
}
else {
- new llvm::BranchInst(fin.back().bb);
+ new llvm::BranchInst(fin.back().bb, p->scopebb());
fin.back().ret = true;
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/bug45.d Wed Oct 31 22:35:39 2007 +0100
@@ -0,0 +1,11 @@
+module bug45;
+
+void foo() {
+ int bar;
+ scope(exit) { bar++; }
+ if (bar) return;
+}
+
+void main() {
+ foo();
+}