JIT: tolerate malformed IL when counting block successors (#83676)
authorAndy Ayers <andya@microsoft.com>
Wed, 22 Mar 2023 19:51:01 +0000 (12:51 -0700)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2023 19:51:01 +0000 (12:51 -0700)
commit1d9c93f729388c443d47843e6d683c2625b2c901
treef01a090c73126062e21964d93d6fa7b3a2dc8712
parenteefaa5a36af292a99be4e4421cb17e56e630f6cd
JIT: tolerate malformed IL when counting block successors (#83676)

If we run synthesis, we may now invoke `BasicBlock::NumSucc` before we've
detected some cases of invalid IL, In particular an endfinally that is not
within a finally (this gets detected during importation).

Tolerate this by reporting that an endfinally with no handler index has no
successors.

Fixes #83674.
src/coreclr/jit/block.cpp