]> granicus.if.org Git - clang/commitdiff
Remove a special case for OSAtomic functions. We can already bind and retrieve
authorZhongxing Xu <xuzhongxing@gmail.com>
Sat, 21 Aug 2010 11:00:26 +0000 (11:00 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sat, 21 Aug 2010 11:00:26 +0000 (11:00 +0000)
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().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111734 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp
lib/Checker/SVals.cpp

index 97344939d3d7b81cc9babf5ba7dac9cdb35186ad..4afa96a4619070565a26801fec09590ad9d3875a 100644 (file)
@@ -1326,14 +1326,8 @@ Store RegionStoreManager::Bind(Store store, Loc L, SVal V) {
       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());
index 7a99e8681df9b56039615fc16404b9f388dcd8b3..3248b0fea25f4eb1a79fff7381daaff55bb4d17b 100644 (file)
@@ -62,6 +62,9 @@ const FunctionDecl *SVal::getAsFunctionDecl() const {
 ///  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))