diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-08-29 19:09:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-29 19:09:54 +0200 |
commit | 2a3b0563141f2cfdee4cbeef85167c25610ff71f (patch) | |
tree | 2a32c413877f8e83d4f92e3a922b4aaef83250c9 /compiler/ccgcalls.nim | |
parent | d0e5bd2305db719b0c9acb6a017c8aa579a2f246 (diff) | |
download | Nim-2a3b0563141f2cfdee4cbeef85167c25610ff71f.tar.gz |
fixes #12042 (#12083)
* fixes #12042 * make tests green again
Diffstat (limited to 'compiler/ccgcalls.nim')
-rw-r--r-- | compiler/ccgcalls.nim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 2ae56863b..4efd33d1e 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -79,9 +79,19 @@ proc genBoundsCheck(p: BProc; arr, a, b: TLoc) proc openArrayLoc(p: BProc, n: PNode): Rope = var a: TLoc - let q = skipConv(n) + var q = skipConv(n) + var skipped = false + while q.kind == nkStmtListExpr and q.len > 0: + skipped = true + q = q.lastSon if getMagic(q) == mSlice: # magic: pass slice to openArray: + if skipped: + q = skipConv(n) + while q.kind == nkStmtListExpr and q.len > 0: + for i in 0..q.len-2: + genStmts(p, q[i]) + q = q.lastSon var b, c: TLoc initLocExpr(p, q[1], a) initLocExpr(p, q[2], b) |