[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.
This commit is contained in:
Christian Kamm
2008-07-14 11:48:55 +02:00
parent 65be990012
commit c1fbcd9942
5 changed files with 71 additions and 4 deletions
+5
View File
@@ -150,7 +150,12 @@ void IRLandingPad::constructLandingPad(llvm::BasicBlock* inBB)
{
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