diff ir/irlandingpad.cpp @ 355:d8357f7004ca trunk

[svn r376] Fix bug with finally blocks and labels. The labels would get emitted multiple times and conflict. It is now possible to add label scopes in IrFunction and all labels names will be prefixed accordingly. Also disallow goto into finally blocks. Fixes nocompile/finally_02 and others.
author ChristianK
date Mon, 14 Jul 2008 11:48:55 +0200
parents d22d8d63c1fd
children 672eb4893b55
line wrap: on
line diff
--- a/ir/irlandingpad.cpp	Mon Jul 14 11:47:03 2008 +0200
+++ b/ir/irlandingpad.cpp	Mon Jul 14 11:48:55 2008 +0200
@@ -150,7 +150,12 @@
         {
             if(switchinst)
                 switchinst = NULL;
+
+            // since this may be emitted multiple times
+            // give the labels a new scope
+            gIR->func()->pushUniqueLabelScope("finally");
             it->finallyBody->toIR(gIR);
+            gIR->func()->popLabelScope();
         }
         // otherwise it's a catch and we'll add a switch case
         else