Fix #308 by giving finally code emitted by EnclosingTryFinally a different landing pad.

This commit is contained in:
Christian Kamm
2009-05-23 00:23:39 +02:00
parent adfc5b3ee9
commit 5b799deeb4
7 changed files with 29 additions and 15 deletions

View File

@@ -255,7 +255,12 @@ void EnclosingVolatile::emitCode(IRState * p)
void EnclosingTryFinally::emitCode(IRState * p)
{
if (tf->finalbody)
{
llvm::BasicBlock* oldpad = p->func()->landingPad;
p->func()->landingPad = landingPad;
tf->finalbody->toIR(p);
p->func()->landingPad = oldpad;
}
}
////////////////////////////////////////////////////////////////////////////////////////