mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-18 23:11:36 +00:00
fix #5968
This commit is contained in:
committed by
Andreas Rumpf
parent
24966e006a
commit
b199c5af4e
@@ -665,7 +665,9 @@ proc genDeref(p: BProc, e: PNode, d: var TLoc; enforceDeref=false) =
|
||||
d.s = OnHeap
|
||||
else:
|
||||
var a: TLoc
|
||||
let typ = skipTypes(e.sons[0].typ, abstractInst)
|
||||
var typ = skipTypes(e.sons[0].typ, abstractInst)
|
||||
if typ.kind in {tyUserTypeClass, tyUserTypeClassInst} and typ.isResolvedUserTypeClass:
|
||||
typ = typ.lastSon
|
||||
if typ.kind == tyVar and tfVarIsPtr notin typ.flags and p.module.compileToCpp and e.sons[0].kind == nkHiddenAddr:
|
||||
initLocExprSingleUse(p, e[0][0], d)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user