From 476b4ff3729165ce3d28f474fe076a27c311c411 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 3 Jul 2019 12:07:01 +0200 Subject: [PATCH] fixes #11636 --- compiler/ccgexprs.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 471ede381..3d3ad4a53 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1650,8 +1650,11 @@ proc makePtrType(baseType: PType): PType = addSonSkipIntLit(result, baseType) proc makeAddr(n: PNode): PNode = - result = newTree(nkHiddenAddr, n) - result.typ = makePtrType(n.typ) + if n.kind == nkHiddenAddr: + result = n + else: + result = newTree(nkHiddenAddr, n) + result.typ = makePtrType(n.typ) proc genSetLengthSeq(p: BProc, e: PNode, d: var TLoc) = if p.config.selectedGc == gcDestructors: