[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.

This commit is contained in:
Christian Kamm
2008-07-14 12:00:24 +02:00
parent c1fbcd9942
commit bcc4cfdea4
5 changed files with 8 additions and 7 deletions

View File

@@ -175,7 +175,7 @@ LabelStatement* DtoLabelStatement(Identifier* ident)
/*////////////////////////////////////////////////////////////////////////////////////////
// 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 @@ void DtoGoto(Loc* loc, Identifier* target, EnclosingHandler* enclosinghandler)
// 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