nested finally bug (#7207)

This commit is contained in:
cooldome 2018-02-12 20:20:49 +00:00 • committed by Andreas Rumpf
commit 7cbab49645
2 changed files with 25 additions and 2 deletions

View file

@ -569,7 +569,7 @@ proc genBreakStmt(p: BProc, t: PNode) =
lineF(p, cpsStmts, "goto $1;$n", [label])
proc genRaiseStmt(p: BProc, t: PNode) =
if p.inExceptBlock > 0:
if p.inExceptBlock > 0 and p.inExceptBlock == p.nestedTryStmts.len:
# if the current try stmt have a finally block,
# we must execute it before reraising
var finallyBlock = p.nestedTryStmts[p.nestedTryStmts.len - 1].lastSon