diff options
author | Araq <rumpf_a@web.de> | 2019-04-17 17:18:47 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-04-17 17:18:47 +0200 |
commit | 850e90ac303cf791369e5fe4827fa1ab2269bdad (patch) | |
tree | fe8fcf1d4db414c5525bbadde8ea2e1e4ae36ec8 | |
parent | 5bdab044f5c252b3e97595f87861adc58238352a (diff) | |
download | Nim-850e90ac303cf791369e5fe4827fa1ab2269bdad.tar.gz |
DFA: We are not allowed to take ownership of parameters
-rw-r--r-- | compiler/dfa.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/dfa.nim b/compiler/dfa.nim index 436fd699f..656e3013b 100644 --- a/compiler/dfa.nim +++ b/compiler/dfa.nim @@ -633,7 +633,8 @@ proc isAnalysableFieldAccess*(n: PNode; owner: PSym): bool = break # XXX Allow closure deref operations here if we know # the owner controlled the closure allocation? - result = n.kind == nkSym and n.sym.owner == owner and owner.kind != skModule + result = n.kind == nkSym and n.sym.owner == owner and + owner.kind != skModule and (n.sym.kind != skParam or isSinkParam(n.sym)) proc genDef(c: var Con; n: PNode) = if n.kind == nkSym and n.sym.kind in InterestingSyms: |