* fixes #13119
* fixes a regression
This commit is contained in:
Andreas Rumpf 2020-01-14 09:56:08 +01:00 • committed by GitHub
commit d56848878c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 5 deletions

View file

@ -352,6 +352,8 @@ proc passCopyToSink(n: PNode; c: var Con): PNode =
("passing '$1' to a sink parameter introduces an implicit copy; " &
"use 'move($1)' to prevent it") % $n)
else:
if c.graph.config.selectedGC in {gcArc, gcOrc}:
assert(not containsGarbageCollectedRef(n.typ))
result.add newTree(nkAsgn, tmp, p(n, c, normal))
result.add tmp