summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-02-19 09:56:08 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-02-19 09:56:08 +0000
commit69aac369c3e95002ddd2a04eb056f17b5ffad6f6 (patch)
tree480ca215fb8b2df1d384f9ec39cf8ea3f49cde28 /clang/lib/Analysis/RegionStore.cpp
parent837707e52ad2496ff5c3b959a456da397e4b5269 (diff)
downloadbcm5719-llvm-69aac369c3e95002ddd2a04eb056f17b5ffad6f6.tar.gz
bcm5719-llvm-69aac369c3e95002ddd2a04eb056f17b5ffad6f6.zip
only track integer and pointer values for now.
llvm-svn: 65041
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index 58d8670d30a..fe0ae17203a 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/lib/Analysis/RegionStore.cpp
@@ -620,8 +620,13 @@ SVal RegionStoreManager::Retrieve(const GRState* St, Loc L, QualType T) {
if (const VarRegion* VR = dyn_cast<VarRegion>(R)) {
const VarDecl *VD = VR->getDecl();
- if (isa<ParmVarDecl>(VD))
- return SVal::GetRValueSymbolVal(getSymbolManager(), VR);
+ if (isa<ParmVarDecl>(VD) || VD->hasGlobalStorage()) {
+ QualType VTy = VD->getType();
+ if (Loc::IsLocType(VTy) || VTy->isIntegerType())
+ return SVal::GetRValueSymbolVal(getSymbolManager(), VR);
+ else
+ return UnknownVal();
+ }
else if (VD == SelfDecl)
return loc::MemRegionVal(getSelfRegion(0));
}
OpenPOWER on IntegriCloud