This commit is contained in:
Arne Döring 2018-10-25 13:42:04 +02:00
commit bab9e0020a

View file

@ -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,16 +874,16 @@ 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: if t[^1].kind == nkFinally:
if catchAllPresent:
genSimpleBlock(p, t[^1][0])
else:
# finally requires catch all presence # finally requires catch all presence
startBlock(p, "catch (...) {$n") startBlock(p, "catch (...) {$n")
genSimpleBlock(p, t[^1][0]) genSimpleBlock(p, t[^1][0])
line(p, cpsStmts, ~"throw;$n") line(p, cpsStmts, ~"throw;$n")
endBlock(p) endBlock(p)
if t[^1].kind == nkFinally:
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:
# #