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.
case BBJ_EHFINALLYRET:
{
+ // We may call this method before we realize we have invalid IL. Tolerate.
+ //
+ if (!hasHndIndex())
+ {
+ return 0;
+ }
+
// The first block of the handler is labelled with the catch type.
BasicBlock* hndBeg = comp->fgFirstBlockOfHandler(this);
if (hndBeg->bbCatchTyp == BBCT_FINALLY)