fixes #5549
This commit is contained in:
parent
f84bf45f17
commit
bab9e0020a
1 changed files with 9 additions and 9 deletions
|
|
@ -509,7 +509,7 @@ proc genWhileStmt(p: BProc, t: PNode) =
|
||||||
# for closure support weird loop bodies are generated:
|
# for closure support weird loop bodies are generated:
|
||||||
if loopBody.len == 2 and loopBody.sons[0].kind == nkEmpty:
|
if loopBody.len == 2 and loopBody.sons[0].kind == nkEmpty:
|
||||||
loopBody = loopBody.sons[1]
|
loopBody = loopBody.sons[1]
|
||||||
genComputedGoto(p, loopBody) # TODO foobar
|
genComputedGoto(p, loopBody)
|
||||||
else:
|
else:
|
||||||
p.breakIdx = startBlock(p, "while (1) {$n")
|
p.breakIdx = startBlock(p, "while (1) {$n")
|
||||||
p.blocks[p.breakIdx].isLoop = true
|
p.blocks[p.breakIdx].isLoop = true
|
||||||
|
|
@ -874,15 +874,15 @@ proc genTryCpp(p: BProc, t: PNode, d: var TLoc) =
|
||||||
|
|
||||||
discard pop(p.nestedTryStmts)
|
discard pop(p.nestedTryStmts)
|
||||||
|
|
||||||
if not catchAllPresent and t[^1].kind == nkFinally:
|
|
||||||
# finally requires catch all presence
|
|
||||||
startBlock(p, "catch (...) {$n")
|
|
||||||
genSimpleBlock(p, t[^1][0])
|
|
||||||
line(p, cpsStmts, ~"throw;$n")
|
|
||||||
endBlock(p)
|
|
||||||
|
|
||||||
if t[^1].kind == nkFinally:
|
if t[^1].kind == nkFinally:
|
||||||
genSimpleBlock(p, t[^1][0])
|
if catchAllPresent:
|
||||||
|
genSimpleBlock(p, t[^1][0])
|
||||||
|
else:
|
||||||
|
# finally requires catch all presence
|
||||||
|
startBlock(p, "catch (...) {$n")
|
||||||
|
genSimpleBlock(p, t[^1][0])
|
||||||
|
line(p, cpsStmts, ~"throw;$n")
|
||||||
|
endBlock(p)
|
||||||
|
|
||||||
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