JIT: fix filter liveness computation (#23044)
authorAndy Ayers <andya@microsoft.com>
Thu, 7 Mar 2019 18:52:19 +0000 (10:52 -0800)
committerGitHub <noreply@github.com>
Thu, 7 Mar 2019 18:52:19 +0000 (10:52 -0800)
commitf6cc0134fa4bb0d2f329ebc18c4eb662a5a5d973
treed52194ca8c1db940b4f3c99a9dc6e772cf2e9d20
parent637900c4d1792d41b0c195904c079277cd80caf9
JIT: fix filter liveness computation (#23044)

When a filter is finished executing, control can logically pass to the
associated handler, any enclosing handler or filter, or any finally or fault
handler nested within the associated try. This is a consequence of two-pass EH.

The jit was not propagating liveness from the nested handlers, which lead to a
live object being collected inadvertently.

This change updates `fgGetHandlerLiveVars` to find the nested handlers and
merge their live-in into the filter block live sets.

Because these implicit EH flow edges can create cycles in the liveness dataflow
equations, the jit will also now always iterate liveness when it sees there is
exception flow, to ensure livness reaches the appropriate fixed point.

Added test case.

Closes #22820.
src/jit/liveness.cpp
tests/src/JIT/Regression/JitBlue/GitHub_22330/GitHub_22330.cs
tests/src/JIT/Regression/JitBlue/GitHub_22820/GitHub_22820.cs [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_22820/GitHub_22820.csproj [new file with mode: 0644]