undo try break
This commit is contained in:
parent
bab9e0020a
commit
cf3d206b9e
1 changed files with 5 additions and 4 deletions
|
|
@ -875,15 +875,16 @@ proc genTryCpp(p: BProc, t: PNode, d: var TLoc) =
|
||||||
discard pop(p.nestedTryStmts)
|
discard pop(p.nestedTryStmts)
|
||||||
|
|
||||||
if t[^1].kind == nkFinally:
|
if t[^1].kind == nkFinally:
|
||||||
if catchAllPresent:
|
# c++ does not have finally, therefore code needs to be generated twice
|
||||||
genSimpleBlock(p, t[^1][0])
|
if not catchAllPresent:
|
||||||
else:
|
|
||||||
# finally requires catch all presence
|
# finally requires catch all presence
|
||||||
startBlock(p, "catch (...) {$n")
|
startBlock(p, "catch (...) {$n")
|
||||||
genSimpleBlock(p, t[^1][0])
|
genStmts(p, t[^1][0])
|
||||||
line(p, cpsStmts, ~"throw;$n")
|
line(p, cpsStmts, ~"throw;$n")
|
||||||
endBlock(p)
|
endBlock(p)
|
||||||
|
|
||||||
|
genSimpleBlock(p, t[^1][0])
|
||||||
|
|
||||||
proc genTry(p: BProc, t: PNode, d: var TLoc) =
|
proc genTry(p: BProc, t: PNode, d: var TLoc) =
|
||||||
# code to generate:
|
# code to generate:
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue