Skip to content

Commit

Permalink
merge D2 pull 145
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jun 20, 2011
1 parent c9056f7 commit d4e602c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -3935,15 +3935,28 @@ int TryCatchStatement::blockExit(bool mustNotThrow)
assert(body);
int result = body->blockExit(false);

int catchresult = 0;
for (size_t i = 0; i < catches->dim; i++)
{
Catch *c = (Catch *)catches->data[i];
if (c->type == Type::terror)
continue;

result |= c->blockExit(mustNotThrow);
catchresult |= c->blockExit(mustNotThrow);

/* If we're catching Object, then there is no throwing
*/
Identifier *id = c->type->toBasetype()->isClassHandle()->ident;
if (id == Id::Object)
{
result &= ~BEthrow;
}
}
return result;
if (mustNotThrow && (result & BEthrow))
{
body->blockExit(mustNotThrow); // now explain why this is nothrow
}
return result | catchresult;
}


Expand Down

0 comments on commit d4e602c

Please sign in to comment.