fixes asyncthreadpool; refc having troubles with closures hooks

This commit is contained in:
ringabout
2025-09-19 21:31:08 +08:00
parent 2f93a48108
commit 0b4c5ba1b5
2 changed files with 3 additions and 2 deletions

View File

@@ -165,7 +165,8 @@ proc isLastReadImpl(n: PNode; c: var Con; scope: var Scope): bool =
template hasDestructorOrAsgn(c: var Con, typ: PType): bool =
# bug #23354; an object type could have a non-trivial assignements when it is passed to a sink parameter
hasDestructor(c, typ) or (typ.kind == tyObject and not isTrivial(getAttachedOp(c.graph, typ, attachedAsgn)))
hasDestructor(c, typ) or (c.graph.config.selectedGC in {gcArc, gcOrc, gcAtomicArc} and
typ.kind == tyObject and not isTrivial(getAttachedOp(c.graph, typ, attachedAsgn)))
proc isLastRead(n: PNode; c: var Con; s: var Scope): bool =
if not hasDestructorOrAsgn(c, n.typ): return true

View File

@@ -1,5 +1,5 @@
discard """
matrix: "--mm:refc; --mm:orc"
matrix: "--mm:orc"
errormsg: "=dup' is not available for type <B>, which is inferred from unavailable '=copy'; requires a copy because it's not the last read of 'b'; another read is done here: t24760.nim(19, 8); routine: g"
"""