aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2016-03-04 00:44:01 +0000
committerEaswaran Raman <eraman@google.com>2016-03-04 00:44:01 +0000
commit3b7a8246c984bf5de8daa346f55a55f7d42d0391 (patch)
tree0b7ff67ee7daa36b2a5bcb9f046be960419cbef9 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parentc8f2c957e077e39283894940576e6e8c9268b8d6 (diff)
downloadllvm-3b7a8246c984bf5de8daa346f55a55f7d42d0391.zip
llvm-3b7a8246c984bf5de8daa346f55a55f7d42d0391.tar.gz
llvm-3b7a8246c984bf5de8daa346f55a55f7d42d0391.tar.bz2
Fix a use-after-free bug introduced in r262636
llvm-svn: 262679
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 923e5b2..251afb5 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1994,8 +1994,11 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
// If we inlined any musttail calls and the original return is now
// unreachable, delete it. It can only contain a bitcast and ret.
- if (InlinedMustTailCalls && pred_begin(AfterCallBB) == pred_end(AfterCallBB))
+ if (InlinedMustTailCalls &&
+ pred_begin(AfterCallBB) == pred_end(AfterCallBB)) {
+ IFI.CallSuccessorBlockDeleted = true;
AfterCallBB->eraseFromParent();
+ }
// We should always be able to fold the entry block of the function into the
// single predecessor of the block...