summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-08-11 17:19:23 +0200
committerGitHub <noreply@github.com>2021-08-11 17:19:23 +0200
commitbc14b7735929f764b09446073375174236fab161 (patch)
tree8e4be8829f609a5ebb7650a9f8ab4617b7431200
parent6c1bd4bb1cb7a6af38b5929fe02b069b03e39db4 (diff)
downloadNim-bc14b7735929f764b09446073375174236fab161.tar.gz
fixes #18665 DFA generator bug (#18676)
-rw-r--r--compiler/dfa.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/dfa.nim b/compiler/dfa.nim
index 402945042..65c483e9c 100644
--- a/compiler/dfa.nim
+++ b/compiler/dfa.nim
@@ -769,6 +769,12 @@ proc gen(c: var Con; n: PNode) =
   of nkCharLit..nkNilLit: discard
   of nkAsgn, nkFastAsgn:
     gen(c, n[1])
+
+    if n[0].kind in PathKinds0:
+      let a = c.skipTrivials(n[0])
+      if a.kind in nkCallKinds:
+        gen(c, a)
+
     # watch out: 'obj[i].f2 = value' sets 'f2' but
     # "uses" 'i'. But we are only talking about builtin array indexing so
     # it doesn't matter and 'x = 34' is NOT a usage of 'x'.