diff options
| author | Daniel Berlin <dberlin@dberlin.org> | 2017-05-19 19:01:21 +0000 |
|---|---|---|
| committer | Daniel Berlin <dberlin@dberlin.org> | 2017-05-19 19:01:21 +0000 |
| commit | a5130bbd12a701fb8aaa10711c5c21da80ecb3ce (patch) | |
| tree | a6de7a0e4738bdc48ec80c9cbcc79a6effc65708 /llvm/lib | |
| parent | 77cfb4a85f09a8330e5901b37e36b5e3ca597f9d (diff) | |
| download | bcm5719-llvm-a5130bbd12a701fb8aaa10711c5c21da80ecb3ce.tar.gz bcm5719-llvm-a5130bbd12a701fb8aaa10711c5c21da80ecb3ce.zip | |
BasicAA: Uninserted instructions have no parent, and notDifferentParent explicitly allows for this case, but getParent crashes when handed one.
llvm-svn: 303442
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index a33c01a0e46..f743cb234c4 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -683,8 +683,11 @@ static bool isIntrinsicCall(ImmutableCallSite CS, Intrinsic::ID IID) { #ifndef NDEBUG static const Function *getParent(const Value *V) { - if (const Instruction *inst = dyn_cast<Instruction>(V)) + if (const Instruction *inst = dyn_cast<Instruction>(V)) { + if (!inst->getParent()) + return nullptr; return inst->getParent()->getParent(); + } if (const Argument *arg = dyn_cast<Argument>(V)) return arg->getParent(); |

