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:47 -0500
committerGanesh Viswanathan <dev@genotrance.com>2018-09-15 14:33:47 -0500
commit9fc0a9ad420876ba9548aa56d4120d6b9bd3a282 (patch)
tree8c31ac5d33be117876bf4577b6ca0e76be512b4d /compiler/ccgexprs.nim
parent9340885251e7791ee5a03f2b75e168f341e231e5 (diff)
parent0e33a8676e325fa4174893291ed41d59b689c577 (diff)
downloadNim-9fc0a9ad420876ba9548aa56d4120d6b9bd3a282.tar.gz
Merge remote-tracking branch 'upstream/devel' into test-7010
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))]