diff gen/statements.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 a7a26f538d6e
children 44daf304421c
line wrap: on
line diff
--- a/gen/statements.cpp	Mon Jul 14 11:47:03 2008 +0200
+++ b/gen/statements.cpp	Mon Jul 14 11:48:55 2008 +0200
@@ -1033,7 +1033,7 @@
     }
     else
     {
-        std::string labelname = ident->toChars();
+        std::string labelname = p->func()->getScopedLabelName(ident->toChars());
         llvm::BasicBlock*& labelBB = p->func()->labelToBB[labelname];
 
         llvm::BasicBlock* oldend = gIR->scopeend();