[cfe-commits] r66486 - /cfe/trunk/lib/Analysis/RegionStore.cpp

Ted Kremenek kremenek at apple.com
Mon Mar 9 15:44:49 PDT 2009


Author: kremenek
Date: Mon Mar  9 17:44:49 2009
New Revision: 66486

URL: http://llvm.org/viewvc/llvm-project?rev=66486&view=rev
Log:
RegionStore::getElementLValue(): Handle the case where the base is a null pointer.

Modified:
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=66486&r1=66485&r2=66486&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Mar  9 17:44:49 2009
@@ -399,7 +399,11 @@
 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.





More information about the cfe-commits mailing list