Skip to content

Commit

Permalink
fixes injects
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Mar 1, 2024
1 parent 8d34dd0 commit 8239c26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/injectdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ proc passCopyToSink(n: PNode; c: var Con; s: var Scope): PNode =
result = newNodeIT(nkStmtListExpr, n.info, n.typ)
let nTyp = n.typ.skipTypes(tyUserTypeClasses)
let tmp = c.getTemp(s, nTyp, n.info)
if hasDestructor(c, nTyp):
let typ = nTyp.skipTypes({tyGenericInst, tyAlias, tySink})
let typ = nTyp.skipTypes({tyGenericInst, tyAlias, tySink})
if hasDestructor(c, nTyp) or (c.graph.config.selectedGC == gcRefc and
getAttachedOp(c.graph, typ, attachedDup) != nil):
let op = getAttachedOp(c.graph, typ, attachedDup)
if op != nil and tfHasOwned notin typ.flags:
if sfError in op.flags:
Expand Down

0 comments on commit 8239c26

Please sign in to comment.