diff options
author | Brandon Pickering <brandonpickering95@gmail.com> | 2017-01-10 21:24:31 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-01-11 06:24:31 +0100 |
commit | da1293c405c3323430cf7dc0f1abcd025b6fe70c (patch) | |
tree | 9249ef308f64625e2c7d3e7ade615042281186a9 /compiler | |
parent | 767524d62a1ecf8bdab1457d08a51f77cedefca3 (diff) | |
download | Nim-da1293c405c3323430cf7dc0f1abcd025b6fe70c.tar.gz |
Reset exprs before return by arg. Fixes #5098 (#5191)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgcalls.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 772a208cb..8ea81ac65 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -30,7 +30,7 @@ proc fixupCall(p: BProc, le, ri: PNode, d: var TLoc, if d.k in {locTemp, locNone} or not leftAppearsOnRightSide(le, ri): # Great, we can use 'd': if d.k == locNone: getTemp(p, typ.sons[0], d, needsInit=true) - elif d.k notin {locExpr, locTemp} and not hasNoInit(ri): + elif d.k notin {locTemp} and not hasNoInit(ri): # reset before pass as 'result' var: resetLoc(p, d) add(pl, addrLoc(d)) @@ -226,7 +226,7 @@ proc genClosureCall(p: BProc, le, ri: PNode, d: var TLoc) = # Great, we can use 'd': if d.k == locNone: getTemp(p, typ.sons[0], d, needsInit=true) - elif d.k notin {locExpr, locTemp} and not hasNoInit(ri): + elif d.k notin {locTemp} and not hasNoInit(ri): # reset before pass as 'result' var: resetLoc(p, d) add(pl, addrLoc(d)) |