diff gen/llvmhelpers.cpp @ 356:44daf304421c trunk

[svn r377] The previous check was too strict, it completely disallowed gotos within finally blocks. This reenables them as long as they don't cross a finally boundary.
author ChristianK
date Mon, 14 Jul 2008 12:00:24 +0200
parents d8357f7004ca
children 82af71383b8a
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Mon Jul 14 11:48:55 2008 +0200
+++ b/gen/llvmhelpers.cpp	Mon Jul 14 12:00:24 2008 +0200
@@ -175,7 +175,7 @@
 /*////////////////////////////////////////////////////////////////////////////////////////
 // GOTO HELPER
 ////////////////////////////////////////////////////////////////////////////////////////*/
-void DtoGoto(Loc* loc, Identifier* target, EnclosingHandler* enclosinghandler)
+void DtoGoto(Loc* loc, Identifier* target, EnclosingHandler* enclosinghandler, TryFinallyStatement* sourcetf)
 {
     assert(!gIR->scopereturned());
 
@@ -204,7 +204,7 @@
 
     // goto into finally blocks is forbidden by the spec
     // though it should not be problematic to implement
-    if(lblstmt->tf)
+    if(lblstmt->tf != sourcetf)
         error(*loc, "spec disallows goto into finally block");
 
     // emit code for finallys between goto and label