diff options
Diffstat (limited to 'compiler/ccgcalls.nim')
-rw-r--r-- | compiler/ccgcalls.nim | 5 |
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: |