diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/BasicStore.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/GRExprEngineInternalChecks.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/GRSimpleVals.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/MemRegion.cpp | 20 |
5 files changed, 22 insertions, 10 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index fcb405d2d2..dd23f31bbe 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -351,7 +351,7 @@ Store BasicStoreManager::BindInternal(Store store, Loc loc, SVal V) { // are incompatible. This may also cause lots of breakage // elsewhere. Food for thought. if (const TypedRegion *TyR = dyn_cast<TypedRegion>(R)) { - if (TyR->isBoundable(C) && + if (TyR->isBoundable() && Loc::IsLocType(TyR->getValueType(C))) V = X->getLoc(); } diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index c58ceb4193..204fbeeb4a 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2835,7 +2835,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, // Remove any existing reference-count binding. if (Sym) state = state->remove<RefBindings>(Sym); - if (R->isBoundable(Ctx)) { + if (R->isBoundable()) { // Set the value of the variable to be a conjured symbol. unsigned Count = Builder.getCurrentBlockCount(); QualType T = R->getValueType(Ctx); diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp index 7f7270d40d..13df89ebbf 100644 --- a/lib/Analysis/GRExprEngineInternalChecks.cpp +++ b/lib/Analysis/GRExprEngineInternalChecks.cpp @@ -717,7 +717,7 @@ public: if (isa<loc::ConcreteInt>(V)) { bool b = false; ASTContext &C = BRC.getASTContext(); - if (R->isBoundable(C)) { + if (R->isBoundable()) { if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) { if (C.isObjCObjectPointerType(TR->getValueType(C))) { os << "initialized to nil"; @@ -748,7 +748,7 @@ public: if (isa<loc::ConcreteInt>(V)) { bool b = false; ASTContext &C = BRC.getASTContext(); - if (R->isBoundable(C)) { + if (R->isBoundable()) { if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) { if (C.isObjCObjectPointerType(TR->getValueType(C))) { os << "nil object reference stored to "; diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp index 7e54f1ad68..878f46d9d5 100644 --- a/lib/Analysis/GRSimpleVals.cpp +++ b/lib/Analysis/GRSimpleVals.cpp @@ -367,8 +367,8 @@ void GRSimpleVals::EvalCall(ExplodedNodeSet<GRState>& Dst, if (isa<loc::MemRegionVal>(V)) { const MemRegion *R = cast<loc::MemRegionVal>(V).getRegion(); - if (R->isBoundable(Eng.getContext())) - St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal()); + if (R->isBoundable()) + St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal()); } else if (isa<nonloc::LocAsInteger>(V)) St = StateMgr.BindLoc(St, cast<nonloc::LocAsInteger>(V).getLoc(), UnknownVal()); diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index ad40f667d3..a923ac29eb 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -37,6 +37,19 @@ bool SubRegion::isSubRegionOf(const MemRegion* R) const { return false; } + +MemRegionManager* SubRegion::getMemRegionManager() const { + const SubRegion* r = this; + do { + const MemRegion *superRegion = r->getSuperRegion(); + if (const SubRegion *sr = dyn_cast<SubRegion>(superRegion)) { + r = sr; + continue; + } + return superRegion->getMemRegionManager(); + } while (1); +} + void MemSpaceRegion::Profile(llvm::FoldingSetNodeID& ID) const { ID.AddInteger((unsigned)getKind()); } @@ -192,13 +205,12 @@ void VarRegion::print(llvm::raw_ostream& os) const { // MemRegionManager methods. //===----------------------------------------------------------------------===// -MemSpaceRegion* MemRegionManager::LazyAllocate(MemSpaceRegion*& region) { - +MemSpaceRegion* MemRegionManager::LazyAllocate(MemSpaceRegion*& region) { if (!region) { region = (MemSpaceRegion*) A.Allocate<MemSpaceRegion>(); - new (region) MemSpaceRegion(); + new (region) MemSpaceRegion(this); } - + return region; } |