From 850e90ac303cf791369e5fe4827fa1ab2269bdad Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 17 Apr 2019 17:18:47 +0200 Subject: [PATCH] DFA: We are not allowed to take ownership of parameters --- compiler/dfa.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/dfa.nim b/compiler/dfa.nim index 436fd699f1..656e3013bf 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: