EH normalization can leave incorrect ref counts. This caused asserts in a few
cases with the forthcoming finally cloning, as these EH related blocks were
exposed to flow optimizations.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7be8f56ce218029bcd4d68f013aacd4070994b22
// this once per dup.
fgReplaceJumpTarget(predBlock, newTryStart, insertBeforeBlk);
+ // Need to adjust ref counts here since we're retargeting edges.
+ newTryStart->bbRefs++;
+ assert(insertBeforeBlk->countOfInEdges() > 0);
+ insertBeforeBlk->bbRefs--;
+
#ifdef DEBUG
if (verbose)
{