diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index fa5c5b894c81..57d726df2db1 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -262,7 +262,8 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { bool passedAsArg = false; for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end(); CI != CE; ++CI) - if (getUnderlyingObject(CI->get()) == P) + if (isa((*CI)->getType()) && + getUnderlyingObject(*CI) == P) passedAsArg = true; if (!passedAsArg)