]> granicus.if.org Git - clang/commitdiff
RegionStore::getElementLValue(): Handle the case where the base is a null pointer.
authorTed Kremenek <kremenek@apple.com>
Mon, 9 Mar 2009 22:44:49 +0000 (22:44 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 9 Mar 2009 22:44:49 +0000 (22:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66486 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index 4c54721e3495bce82c6774219f4f1491c0dd790c..2f4d70a577a0d1895d91f61f567b7ce24f08abb7 100644 (file)
@@ -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.