diff options
author | zah <zahary@gmail.com> | 2017-03-19 21:33:21 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-03-19 20:33:21 +0100 |
commit | 1d6018726eea88b8cd7bf9a9bc975525f083e4d1 (patch) | |
tree | df54fd2645535f5cb84aa91395da4c58365e1c57 /compiler | |
parent | e20af5cec68520a7ed96a6fd130af2fa56f6709b (diff) | |
download | Nim-1d6018726eea88b8cd7bf9a9bc975525f083e4d1.tar.gz |
fix #5296 (#5565)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sempass2.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 437a45817..8193a3537 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -577,6 +577,9 @@ proc trackOperand(tracked: PEffects, n: PNode, paramType: PType) = markGcUnsafe(tracked, a) elif tfNoSideEffect notin op.flags: markSideEffect(tracked, a) + if paramType != nil and paramType.kind == tyVar: + if n.kind == nkSym and isLocalVar(tracked, n.sym): + makeVolatile(tracked, n.sym) notNilCheck(tracked, n, paramType) proc breaksBlock(n: PNode): bool = |