fixes #18665 DFA generator bug (#18676)

This commit is contained in:
Andreas Rumpf 2021-08-11 17:19:23 +02:00 • committed by GitHub
commit bc14b77359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -769,6 +769,12 @@ proc gen(c: var Con; n: PNode) =
of nkCharLit..nkNilLit: discard of nkCharLit..nkNilLit: discard
of nkAsgn, nkFastAsgn: of nkAsgn, nkFastAsgn:
gen(c, n[1]) 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 # watch out: 'obj[i].f2 = value' sets 'f2' but
# "uses" 'i'. But we are only talking about builtin array indexing so # "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'. # it doesn't matter and 'x = 34' is NOT a usage of 'x'.