fixes #11215
This commit is contained in:
parent
a83d609960
commit
a3e27ffa2c
2 changed files with 4 additions and 4 deletions
|
|
@ -364,10 +364,10 @@ proc ownedRefOp(c: var TLiftCtx; t: PType; body, x, y: PNode) =
|
||||||
#var disposeCall = genBuiltin(c.graph, mDispose, "dispose", x)
|
#var disposeCall = genBuiltin(c.graph, mDispose, "dispose", x)
|
||||||
|
|
||||||
if isFinal(elemType):
|
if isFinal(elemType):
|
||||||
addDestructorCall(c, elemType, actions, genDeref(x))
|
addDestructorCall(c, elemType, actions, genDeref(x, nkDerefExpr))
|
||||||
actions.add callCodegenProc(c.graph, "nimRawDispose", c.info, x)
|
actions.add callCodegenProc(c.graph, "nimRawDispose", c.info, x)
|
||||||
else:
|
else:
|
||||||
addDestructorCall(c, elemType, newNodeI(nkStmtList, c.info), genDeref(x))
|
addDestructorCall(c, elemType, newNodeI(nkStmtList, c.info), genDeref(x, nkDerefExpr))
|
||||||
actions.add callCodegenProc(c.graph, "nimDestroyAndDispose", c.info, x)
|
actions.add callCodegenProc(c.graph, "nimDestroyAndDispose", c.info, x)
|
||||||
|
|
||||||
case c.kind
|
case c.kind
|
||||||
|
|
|
||||||
|
|
@ -300,8 +300,8 @@ proc genAddrOf*(n: PNode): PNode =
|
||||||
result.typ = newType(tyPtr, n.typ.owner)
|
result.typ = newType(tyPtr, n.typ.owner)
|
||||||
result.typ.rawAddSon(n.typ)
|
result.typ.rawAddSon(n.typ)
|
||||||
|
|
||||||
proc genDeref*(n: PNode): PNode =
|
proc genDeref*(n: PNode; k = nkHiddenDeref): PNode =
|
||||||
result = newNodeIT(nkHiddenDeref, n.info,
|
result = newNodeIT(k, n.info,
|
||||||
n.typ.skipTypes(abstractInst).sons[0])
|
n.typ.skipTypes(abstractInst).sons[0])
|
||||||
result.add n
|
result.add n
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue