bugfix: finally blocks were not executed when the except block is exited by raise or return

This commit is contained in:
Zahary Karadjov 2012-06-03 18:00:45 +03:00
commit 3ce400bb00
3 changed files with 87 additions and 13 deletions

View file

@ -62,8 +62,9 @@ type
ThreadVarAccessed*: bool # true if the proc already accessed some threadvar
nestedTryStmts*: seq[PNode] # in how many nested try statements we are
# (the vars must be volatile then)
popCurrExc*: Natural # how often to emit 'popCurrentException()'
# before 'break'|'return'
inExceptBlock*: int # are we currently inside an except block?
# leaving such scopes by raise or by return must
# execute any applicable finally blocks
labels*: Natural # for generating unique labels in the C proc
blocks*: seq[TBlock] # nested blocks
breakIdx*: int # the block that will be exited