summary refs log tree commit diff stats
path: root/compiler/ccgcalls.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-06-06 11:06:57 +0200
committerGitHub <noreply@github.com>2018-06-06 11:06:57 +0200
commit1593b9cac4b9a5671c21e7eefaab65ace7dd0222 (patch)
tree12e79271a7dac654b1b2369e6b42086d9c925b62 /compiler/ccgcalls.nim
parent97cf2a309a69f0a8f2250aef370e3ebc587311a4 (diff)
parent7297195f9fc5aa47de4b64f1402cfc7af109badc (diff)
downloadNim-1593b9cac4b9a5671c21e7eefaab65ace7dd0222.tar.gz
Merge pull request #7967 from nitely/empty_openarray_7904
support empty toOpenArray
Diffstat (limited to 'compiler/ccgcalls.nim')
-rw-r--r--compiler/ccgcalls.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim
index 7d355db5f..22733f6ac 100644
--- a/compiler/ccgcalls.nim
+++ b/compiler/ccgcalls.nim
@@ -83,7 +83,7 @@ proc isInCurrentFrame(p: BProc, n: PNode): bool =
     result = isInCurrentFrame(p, n.sons[0])
   else: discard
 
-proc genIndexCheck(p: BProc; arr, idx: TLoc)
+proc genBoundsCheck(p: BProc; arr, a, b: TLoc)
 
 proc openArrayLoc(p: BProc, n: PNode): Rope =
   var a: TLoc
@@ -97,8 +97,7 @@ proc openArrayLoc(p: BProc, n: PNode): Rope =
     initLocExpr(p, q[3], c)
     # but first produce the required index checks:
     if optBoundsCheck in p.options:
-      genIndexCheck(p, a, b)
-      genIndexCheck(p, a, c)
+      genBoundsCheck(p, a, b, c)
     let ty = skipTypes(a.t, abstractVar+{tyPtr})
     case ty.kind
     of tyArray: