summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2018-09-15 14:33:15 -0500
committerGanesh Viswanathan <dev@genotrance.com>2018-09-15 14:33:15 -0500
commite4fa1c81cb555a726fa79133bb20e938e8c68b02 (patch)
tree1185eab4bd2c2e66567c2dba0fe988355595ceb3 /compiler/ccgexprs.nim
parentb966945ab219e58023cdf85c77804519c96c231e (diff)
parent0e33a8676e325fa4174893291ed41d59b689c577 (diff)
downloadNim-e4fa1c81cb555a726fa79133bb20e938e8c68b02.tar.gz
Merge remote-tracking branch 'upstream/devel' into test-6434
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 56ecf5ba3..a7a28a51c 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1596,10 +1596,11 @@ proc genSwap(p: BProc, e: PNode, d: var TLoc) =
   genAssignment(p, a, b, {})
   genAssignment(p, b, tmp, {})
 
-proc rdSetElemLoc(conf: ConfigRef; a: TLoc, setType: PType): Rope =
+proc rdSetElemLoc(conf: ConfigRef; a: TLoc, typ: PType): Rope =
   # read a location of an set element; it may need a subtraction operation
   # before the set operation
   result = rdCharLoc(a)
+  let setType = typ.skipTypes(abstractPtrs)
   assert(setType.kind == tySet)
   if firstOrd(conf, setType) != 0:
     result = "($1- $2)" % [result, rope(firstOrd(conf, setType))]