dec inLoop after exiting the while scope in computeLiveRanges [backport] (#19918)

* dec inLoop after exiting the while scope in computeLiveRanges

* add testcase
This commit is contained in:
flywind
2022-06-29 22:37:24 +08:00
committed by GitHub
parent 8a344cb25b
commit bcff13debc
2 changed files with 46 additions and 1 deletions

View File

@@ -851,7 +851,7 @@ proc computeLiveRanges(c: var Partitions; n: PNode) =
# connect(graph, cursorVar)
inc c.inLoop
for child in n: computeLiveRanges(c, child)
inc c.inLoop
dec c.inLoop
of nkElifBranch, nkElifExpr, nkElse, nkOfBranch:
inc c.inConditional
for child in n: computeLiveRanges(c, child)