aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/Lint.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-11 19:23:51 +0000
committerDan Gohman <gohman@apple.com>2010-11-11 19:23:51 +0000
commitf3b8c7659979ff481e7a15fa3406b280e425cf0d (patch)
tree726eb3c229d88e8c7c5651e585fa2128465142e3 /lib/Analysis/Lint.cpp
parentc7139a6f0d3acd198ab9eb536ea1ec52e61ff130 (diff)
downloadexternal_llvm-f3b8c7659979ff481e7a15fa3406b280e425cf0d.zip
external_llvm-f3b8c7659979ff481e7a15fa3406b280e425cf0d.tar.gz
external_llvm-f3b8c7659979ff481e7a15fa3406b280e425cf0d.tar.bz2
Avoid calling alias on non-pointer values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Lint.cpp')
-rw-r--r--lib/Analysis/Lint.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/Lint.cpp b/lib/Analysis/Lint.cpp
index b27ca47..4318a30 100644
--- a/lib/Analysis/Lint.cpp
+++ b/lib/Analysis/Lint.cpp
@@ -231,10 +231,11 @@ void Lint::visitCallSite(CallSite CS) {
// to do. Known partial overlap is not distinguished from the case
// where nothing is known.
if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy())
- for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI) {
- Assert1(AI == BI || AA->alias(*AI, *BI) != AliasAnalysis::MustAlias,
+ for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI)
+ Assert1(AI == BI ||
+ !(*BI)->getType()->isPointerTy() ||
+ AA->alias(*AI, *BI) != AliasAnalysis::MustAlias,
"Unusual: noalias argument aliases another argument", &I);
- }
// Check that an sret argument points to valid memory.
if (Formal->hasStructRetAttr() && Actual->getType()->isPointerTy()) {