* decrement the reference of unreachable finally
* Proper fix
Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
continue;
}
+ // If the finally's block jumps back to itself, then it is not empty.
+ if ((firstBlock->bbJumpKind == BBJ_ALWAYS) && firstBlock->bbJumpDest == firstBlock)
+ {
+ JITDUMP("EH#%u finally has basic block that jumps to itself; skipping.\n", XTnum);
+ XTnum++;
+ continue;
+ }
+
// Limit for now to finallys that contain only a GT_RETFILT.
bool isEmpty = true;
#endif // DEBUG
// The first block of a handler has an artificial extra refcount. Transfer that to the new block.
- assert(block->bbRefs > 0);
+ noway_assert(block->countOfInEdges() > 0);
block->bbRefs--;
HBtab->ebdHndBeg = bPrev;
#endif // DEBUG
// The first block of a filter has an artificial extra refcount. Transfer that to the new block.
- assert(block->bbRefs > 0);
+ noway_assert(block->countOfInEdges() > 0);
block->bbRefs--;
HBtab->ebdFilter = bPrev;