Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 committed Oct 25, 2018
1 parent 902fdb4 commit 6086fc5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions compiler/ccgstmts.nim
Expand Up @@ -509,7 +509,7 @@ proc genWhileStmt(p: BProc, t: PNode) =
# for closure support weird loop bodies are generated:
if loopBody.len == 2 and loopBody.sons[0].kind == nkEmpty:
loopBody = loopBody.sons[1]
genComputedGoto(p, loopBody) # TODO foobar
genComputedGoto(p, loopBody)
else:
p.breakIdx = startBlock(p, "while (1) {$n")
p.blocks[p.breakIdx].isLoop = true
Expand Down Expand Up @@ -872,15 +872,15 @@ proc genTryCpp(p: BProc, t: PNode, d: var TLoc) =

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:
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) =
# code to generate:
Expand Down

0 comments on commit 6086fc5

Please sign in to comment.