diff options
author | Easwaran Raman <eraman@google.com> | 2016-03-04 00:44:01 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2016-03-04 00:44:01 +0000 |
commit | 3b7a8246c984bf5de8daa346f55a55f7d42d0391 (patch) | |
tree | 0b7ff67ee7daa36b2a5bcb9f046be960419cbef9 /llvm/lib/Transforms/IPO | |
parent | c8f2c957e077e39283894940576e6e8c9268b8d6 (diff) | |
download | bcm5719-llvm-3b7a8246c984bf5de8daa346f55a55f7d42d0391.tar.gz bcm5719-llvm-3b7a8246c984bf5de8daa346f55a55f7d42d0391.zip |
Fix a use-after-free bug introduced in r262636
llvm-svn: 262679
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 8ed4bda54ad..c82c7dfe4cf 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -580,11 +580,13 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) { continue; } updateEntryCount(CallSiteBlock, Callee); - // The instruction following the call is part of a new basic block - // created during the inlining process. This does not have an entry in - // the BFI. We create an entry by copying the frequency of the original - // block containing the call. - copyBlockFrequency(CallSiteBlock, CallSuccessor->getParent()); + if (!InlineInfo.CallSuccessorBlockDeleted) { + // The instruction following the call is part of a new basic block + // created during the inlining process. This does not have an entry in + // the BFI. We create an entry by copying the frequency of the + // original block containing the call. + copyBlockFrequency(CallSiteBlock, CallSuccessor->getParent()); + } ++NumInlined; |