summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-08-21 11:00:26 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-08-21 11:00:26 +0000
commit5cba6c85c93c1332b011bc7f6a179b32361201ea (patch)
tree493307c2fdfb92a7646250f289fe3e5f1233cb37
parent4887165193e8830f2cda9a53663a6ef21d8467b3 (diff)
downloadbcm5719-llvm-5cba6c85c93c1332b011bc7f6a179b32361201ea.tar.gz
bcm5719-llvm-5cba6c85c93c1332b011bc7f6a179b32361201ea.zip
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(). llvm-svn: 111734
-rw-r--r--clang/lib/Checker/RegionStore.cpp8
-rw-r--r--clang/lib/Checker/SVals.cpp3
2 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp
index 97344939d3d..4afa96a4619 100644
--- a/clang/lib/Checker/RegionStore.cpp
+++ b/clang/lib/Checker/RegionStore.cpp
@@ -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());
diff --git a/clang/lib/Checker/SVals.cpp b/clang/lib/Checker/SVals.cpp
index 7a99e8681df..3248b0fea25 100644
--- a/clang/lib/Checker/SVals.cpp
+++ b/clang/lib/Checker/SVals.cpp
@@ -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))
OpenPOWER on IntegriCloud