fixes #18665 DFA generator bug (#18676)

This commit is contained in:
Andreas Rumpf
2021-08-11 17:19:23 +02:00
committed by GitHub
parent 6c1bd4bb1c
commit bc14b77359

View File

@@ -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'.