* test CI * fixes #19457 * add comments Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
This commit is contained in:
parent
95614089ac
commit
fe8feb46c6
3 changed files with 48 additions and 15 deletions
|
|
@ -767,6 +767,11 @@ proc traverse(c: var Partitions; n: PNode) =
|
|||
# mutate(graph)
|
||||
# connect(graph, cursorVar)
|
||||
for child in n: traverse(c, child)
|
||||
|
||||
if n.kind == nkWhileStmt:
|
||||
traverse(c, n[0])
|
||||
# variables in while condition has longer alive time than local variables
|
||||
# in the while loop body
|
||||
else:
|
||||
for child in n: traverse(c, child)
|
||||
|
||||
|
|
@ -854,6 +859,11 @@ proc computeLiveRanges(c: var Partitions; n: PNode) =
|
|||
inc c.inLoop
|
||||
for child in n: computeLiveRanges(c, child)
|
||||
dec c.inLoop
|
||||
|
||||
if n.kind == nkWhileStmt:
|
||||
computeLiveRanges(c, n[0])
|
||||
# variables in while condition has longer alive time than local variables
|
||||
# in the while loop body
|
||||
of nkElifBranch, nkElifExpr, nkElse, nkOfBranch:
|
||||
inc c.inConditional
|
||||
for child in n: computeLiveRanges(c, child)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue