summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-09 22:44:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-09 22:44:49 +0000
commit0603222888e8fd1932c7cc45617c79fe2e023276 (patch)
tree8fd258ba91f503172499202aa56d06957885640a /clang/lib/Analysis/RegionStore.cpp
parent3987bbee343ca09a10845f95db6c146b2c448fc8 (diff)
downloadbcm5719-llvm-0603222888e8fd1932c7cc45617c79fe2e023276.tar.gz
bcm5719-llvm-0603222888e8fd1932c7cc45617c79fe2e023276.zip
RegionStore::getElementLValue(): Handle the case where the base is a null pointer.
llvm-svn: 66486
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index 4c54721e349..2f4d70a577a 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/lib/Analysis/RegionStore.cpp
@@ -399,7 +399,11 @@ SVal RegionStoreManager::getLValueFieldOrIvar(const GRState* St, SVal Base,
SVal RegionStoreManager::getLValueElement(const GRState* St,
SVal Base, SVal Offset) {
- if (Base.isUnknownOrUndef())
+ // If the base is an unknown or undefined value, just return it back.
+ // FIXME: For absolute pointer addresses, we just return that value back as
+ // well, although in reality we should return the offset added to that
+ // value.
+ if (Base.isUnknownOrUndef() || isa<loc::ConcreteInt>(Base))
return Base;
// Only handle integer offsets... for now.
OpenPOWER on IntegriCloud