This commit is contained in:
ringabout
2026-08-12 22:24:57 +08:00
parent 2dc1be8c47
commit 9a8a9efbd5

View File

@@ -958,7 +958,6 @@ proc p(n: PNode; c: var Con; s: var Scope; mode: ProcessMode; tmpFlags = {sfSing
if canRaise(n[0]): s.needsTry = true
# A raising call needs owned storage even when its value is consumed: the
# callee can partially initialize the result before control unwinds.
# injection of its own.
if mode == normal or (canRaise(n[0]) and inSpawn == 0):
if result.typ != nil and result.typ.kind notin {tyOpenArray, tyVarargs}:
# Returns of openarray types shouldn't be destroyed