summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2017-08-31 18:27:47 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2017-08-31 18:27:47 +0000
commit13d2beb14d0eceb9421bf3a8f4ea761e6afcef09 (patch)
treedc305ee096c12410153171b735866d3487b9b78f /llvm/lib/Transforms
parenta6fc06babc7e0b057ee32b17eb350678038c3736 (diff)
downloadbcm5719-llvm-13d2beb14d0eceb9421bf3a8f4ea761e6afcef09.tar.gz
bcm5719-llvm-13d2beb14d0eceb9421bf3a8f4ea761e6afcef09.zip
[ObjCARC] Pass the correct BasicBlock to fix assertion failure.
The BasicBlock passed to FindPredecessorRetainWithSafePath should be the parent block of Autorelease. This fixes a crash that occurs in FindDependencies when StartInst is not in StartBB. rdar://problem/33866381 llvm-svn: 312266
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
index 8f3a33f66c7..8c0a90843ef 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
@@ -2027,7 +2027,8 @@ void ObjCARCOpt::OptimizeReturns(Function &F) {
continue;
CallInst *Retain = FindPredecessorRetainWithSafePath(
- Arg, &BB, Autorelease, DependingInstructions, Visited, PA);
+ Arg, Autorelease->getParent(), Autorelease, DependingInstructions,
+ Visited, PA);
DependingInstructions.clear();
Visited.clear();
OpenPOWER on IntegriCloud