[cfe-commits] r111734 - in /cfe/trunk/lib/Checker: RegionStore.cpp SVals.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sat Aug 21 04:00:26 PDT 2010


Author: zhongxingxu
Date: Sat Aug 21 06:00:26 2010
New Revision: 111734

URL: http://llvm.org/viewvc/llvm-project?rev=111734&view=rev
Log:
Remove a special case for OSAtomic functions. We can already bind and retrieve
with the same binding key. The only trick here is that sometimes the Symbolic
region is stored in with an LocAsInteger wrapper. We unwrap that in 
SVal::getAsLocSymbol().

Modified:
    cfe/trunk/lib/Checker/RegionStore.cpp
    cfe/trunk/lib/Checker/SVals.cpp

Modified: cfe/trunk/lib/Checker/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/RegionStore.cpp?rev=111734&r1=111733&r2=111734&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/RegionStore.cpp (original)
+++ cfe/trunk/lib/Checker/RegionStore.cpp Sat Aug 21 06:00:26 2010
@@ -1326,14 +1326,8 @@
       if (const TypedRegion *superR =
             dyn_cast<TypedRegion>(ER->getSuperRegion())) {
         QualType superTy = superR->getValueType();
-        QualType erTy = ER->getValueType();
-
-        if (IsAnyPointerOrIntptr(superTy, Ctx) &&
-            IsAnyPointerOrIntptr(erTy, Ctx)) {
-          V = ValMgr.getSValuator().EvalCast(V, superTy, erTy);
-          return Bind(store, loc::MemRegionVal(superR), V);
-        }
         // For now, just invalidate the fields of the struct/union/class.
+        // This is for test: undef-buffers.c
         // FIXME: Precisely handle the fields of the record.
         if (superTy->isStructureOrClassType())
           return KillStruct(store, superR, UnknownVal());

Modified: cfe/trunk/lib/Checker/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/SVals.cpp?rev=111734&r1=111733&r2=111734&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/SVals.cpp (original)
+++ cfe/trunk/lib/Checker/SVals.cpp Sat Aug 21 06:00:26 2010
@@ -62,6 +62,9 @@
 ///  wraps a symbol, return that SymbolRef.  Otherwise return 0.
 // FIXME: should we consider SymbolRef wrapped in CodeTextRegion?
 SymbolRef SVal::getAsLocSymbol() const {
+  if (const nonloc::LocAsInteger *X = dyn_cast<nonloc::LocAsInteger>(this))
+    return X->getLoc().getAsLocSymbol();
+
   if (const loc::MemRegionVal *X = dyn_cast<loc::MemRegionVal>(this)) {
     const MemRegion *R = X->StripCasts();
     if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(R))





More information about the cfe-commits mailing list