diff options
author | Andy Ayers <andya@microsoft.com> | 2017-01-03 13:30:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 13:30:09 -0800 |
commit | 7be8f56ce218029bcd4d68f013aacd4070994b22 (patch) | |
tree | 36abeb13882a7b405815b4a622dfbda9a9faa027 /src/jit/jiteh.cpp | |
parent | 1d15b16516ebc580d88d179e8cdf800bbeac1b4b (diff) | |
download | coreclr-7be8f56ce218029bcd4d68f013aacd4070994b22.tar.gz coreclr-7be8f56ce218029bcd4d68f013aacd4070994b22.tar.bz2 coreclr-7be8f56ce218029bcd4d68f013aacd4070994b22.zip |
Adjust ref counts during EH normalization (#8713)
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.
Diffstat (limited to 'src/jit/jiteh.cpp')
-rw-r--r-- | src/jit/jiteh.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jit/jiteh.cpp b/src/jit/jiteh.cpp index 4b3ceaecf6..01a2fdce83 100644 --- a/src/jit/jiteh.cpp +++ b/src/jit/jiteh.cpp @@ -2426,6 +2426,11 @@ bool Compiler::fgNormalizeEHCase2() // 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) { |