aboutsummaryrefslogtreecommitdiff
path: root/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
commitde7ec634a4ba328b4108a7d13ef511f6a77f95c0 (patch)
tree832f743e4373000151509e4cd101f5b06cd7a0ef /lib/Analysis/RegionStore.cpp
parentcd57fcec52c48c781700653cf7c39143110b2b1d (diff)
RegionStore::getElementLValue(): Handle the case where the base is a null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 4c54721e34..2f4d70a577 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/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.