diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-24 19:07:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-24 19:07:10 +0000 |
commit | 36d0a1fb418be68e295a8d3910a9e2c1cab6049c (patch) | |
tree | f88c6c9dd02c0c076a4a2bb5c140178fa779666b /lib/Analysis | |
parent | 694bb3cc357764de7aad0a2a4ae8249022340733 (diff) | |
download | external_llvm-36d0a1fb418be68e295a8d3910a9e2c1cab6049c.zip external_llvm-36d0a1fb418be68e295a8d3910a9e2c1cab6049c.tar.gz external_llvm-36d0a1fb418be68e295a8d3910a9e2c1cab6049c.tar.bz2 |
getUnderlyingObject can return null, handle this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 381298b..be8fe07 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -245,8 +245,9 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { if (!isa<Constant>(P)) { const Value *Object = getUnderlyingObject(P); // Allocations and byval arguments are "new" objects. - if (isa<AllocationInst>(Object) || - (isa<Argument>(Object) && cast<Argument>(Object)->hasByValAttr())) { + if (Object && + (isa<AllocationInst>(Object) || + (isa<Argument>(Object) && cast<Argument>(Object)->hasByValAttr()))) { // Okay, the pointer is to a stack allocated object. If we can prove that // the pointer never "escapes", then we know the call cannot clobber it, // because it simply can't get its address. |