Add an assert concerning branch to BBJ_CALLFINALLY blocks (#55858)
authorBruce Forstall <brucefo@microsoft.com>
Mon, 19 Jul 2021 20:03:22 +0000 (13:03 -0700)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 20:03:22 +0000 (13:03 -0700)
commitc8f9a24ca0ebf6d9593e00ccbc7353510a0e0213
treeb8d4157f745a0308942ed110a17f9525f72de7bb
parente0024e22c7761cbbdd10a845f8b0269ea654cbfc
Add an assert concerning branch to BBJ_CALLFINALLY blocks (#55858)

In the FEATURE_EH_CALLFINALLY_THUNKS case, BBJ_CALLFINALLY blocks live
in the EH region enclosing the `try` block that needs to call the finally.
However, we need all flow to the BBJ_CALLFINALLY to come from that try block;
we don't want flow optimizations to otherwise branch directly to this
BBJ_CALLFINALLY block. Add an assert to verify this is the case. The assert
also covers the non-FEATURE_EH_CALLFINALLY_THUNKS case.
src/coreclr/jit/fgdiagnostic.cpp