Skip to content

Commit

Permalink
nim check fix; fixes #9609 [backport]
Browse files Browse the repository at this point in the history
(cherry picked from commit 1c73db0)
  • Loading branch information
Araq authored and narimiran committed Nov 24, 2018
1 parent 4cece52 commit 5f7679c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions compiler/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1088,13 +1088,14 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
of mEcho:
unused(c, n, dest)
let n = n[1].skipConv
let x = c.getTempRange(n.len, slotTempUnknown)
internalAssert c.config, n.kind == nkBracket
for i in 0..<n.len:
var r: TRegister = x+i
c.gen(n.sons[i], r)
c.gABC(n, opcEcho, x, n.len)
c.freeTempRange(x, n.len)
if n.kind == nkBracket:
# can happen for nim check, see bug #9609
let x = c.getTempRange(n.len, slotTempUnknown)
for i in 0..<n.len:
var r: TRegister = x+i
c.gen(n.sons[i], r)
c.gABC(n, opcEcho, x, n.len)
c.freeTempRange(x, n.len)
of mAppendStrCh:
unused(c, n, dest)
genBinaryStmtVar(c, n, opcAddStrCh)
Expand Down

0 comments on commit 5f7679c

Please sign in to comment.