This commit is contained in:
Andreas Rumpf
2020-01-14 12:57:20 +01:00
committed by GitHub
parent d56848878c
commit 9fc04a555c
2 changed files with 19 additions and 1 deletions

View File

@@ -336,7 +336,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) =
else:
linefmt(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)])
of tyArray:
if containsGarbageCollectedRef(dest.t):
if containsGarbageCollectedRef(dest.t) and p.config.selectedGC notin {gcArc, gcOrc, gcHooks}:
genGenericAsgn(p, dest, src, flags)
else:
linefmt(p, cpsStmts,

View File

@@ -4,6 +4,8 @@ discard """
Success
@["a", "b", "c"]
Hello
1
2
0'''
cmd: '''nim c --gc:arc $file'''
"""
@@ -126,4 +128,20 @@ proc bug13119 =
bug13119()
# bug #13105
type
Result[T, E] = object
a: T
b: E
D = ref object
x: int
R = Result[D, int]
proc bug13105 =
for n in [R(b: 1), R(b: 2)]:
echo n.b
bug13105()
echo getOccupiedMem() - startMem