From: Chris Lattner Date: Thu, 24 Jan 2008 19:07:10 +0000 (+0000) Subject: getUnderlyingObject can return null, handle this. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d087480166d8f0ec2a44732c7ec087f4eb1ba527;p=oota-llvm.git getUnderlyingObject can return null, handle this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46318 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 381298b86ea..be8fe07f2c9 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(P)) { const Value *Object = getUnderlyingObject(P); // Allocations and byval arguments are "new" objects. - if (isa(Object) || - (isa(Object) && cast(Object)->hasByValAttr())) { + if (Object && + (isa(Object) || + (isa(Object) && cast(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.