mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 12:24:19 +00:00
fixes #22787
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
(cherry picked from commit efa64aa49b)
This commit is contained in:
@@ -820,6 +820,10 @@ proc computeLiveRanges(c: var Partitions; n: PNode) =
|
||||
registerVariable(c, child[i])
|
||||
#deps(c, child[i], last)
|
||||
|
||||
if c.inLoop > 0 and child[0].kind == nkSym: # bug #22787
|
||||
let vid = variableId(c, child[0].sym)
|
||||
if child[^1].kind != nkEmpty:
|
||||
markAsReassigned(c, vid)
|
||||
of nkAsgn, nkFastAsgn, nkSinkAsgn:
|
||||
computeLiveRanges(c, n[0])
|
||||
computeLiveRanges(c, n[1])
|
||||
|
||||
Reference in New Issue
Block a user