diff gen/llvmhelpers.cpp @ 1160:7d28dcbff23e

Reenable error for gotos into or out of finally blocks.
author Christian Kamm <kamm incasoftware de>
date Sat, 28 Mar 2009 19:16:53 +0100
parents 3cf0066e6faf
children ed4b050ada45
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Sat Mar 28 14:39:16 2009 +0100
+++ b/gen/llvmhelpers.cpp	Sat Mar 28 19:16:53 2009 +0100
@@ -172,7 +172,7 @@
 /*////////////////////////////////////////////////////////////////////////////////////////
 // GOTO HELPER
 ////////////////////////////////////////////////////////////////////////////////////////*/
-void DtoGoto(Loc loc, Identifier* target)
+void DtoGoto(Loc loc, Identifier* target, TryFinallyStatement* sourceFinally)
 {
     assert(!gIR->scopereturned());
 
@@ -199,11 +199,10 @@
 
     // goto into finally blocks is forbidden by the spec
     // but should work fine
-    /*
-    if(lblstmt->tf != sourcetf) {
-        error(loc, "spec disallows goto into finally block");
+    if(lblstmt->enclosingFinally != sourceFinally) {
+        error(loc, "spec disallows goto into or out of finally block");
         fatal();
-    }*/
+    }
 
     llvm::BranchInst::Create(targetBB, gIR->scopebb());
 }