opnsense-src/lib/Checker/BasicStore.cpp

495 lines
16 KiB
C++
Raw Normal View History

2009-06-02 13:58:47 -04:00
//== BasicStore.cpp - Basic map from Locations to Values --------*- C++ -*--==//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defined the BasicStore and BasicStoreManager classes.
//
//===----------------------------------------------------------------------===//
#include "clang/AST/ExprObjC.h"
#include "clang/Analysis/Analyses/LiveVariables.h"
2010-02-16 04:31:36 -05:00
#include "clang/Analysis/AnalysisContext.h"
#include "clang/Checker/PathSensitive/GRState.h"
2009-10-14 14:03:49 -04:00
#include "llvm/ADT/ImmutableMap.h"
2009-06-02 13:58:47 -04:00
using namespace clang;
2009-10-14 14:03:49 -04:00
typedef llvm::ImmutableMap<const MemRegion*,SVal> BindingsTy;
2009-06-02 13:58:47 -04:00
namespace {
2009-10-14 14:03:49 -04:00
2009-12-01 06:08:04 -05:00
class BasicStoreSubRegionMap : public SubRegionMap {
2009-06-02 13:58:47 -04:00
public:
BasicStoreSubRegionMap() {}
bool iterSubRegions(const MemRegion* R, Visitor& V) const {
return true; // Do nothing. No subregions.
}
};
2009-10-14 14:03:49 -04:00
2009-12-01 06:08:04 -05:00
class BasicStoreManager : public StoreManager {
2009-06-02 13:58:47 -04:00
BindingsTy::Factory VBFactory;
public:
BasicStoreManager(GRStateManager& mgr)
2009-10-14 14:03:49 -04:00
: StoreManager(mgr), VBFactory(mgr.getAllocator()) {}
2009-06-02 13:58:47 -04:00
~BasicStoreManager() {}
2010-02-16 04:31:36 -05:00
SubRegionMap *getSubRegionMap(Store store) {
2009-06-02 13:58:47 -04:00
return new BasicStoreSubRegionMap();
}
2010-02-16 04:31:36 -05:00
SVal Retrieve(Store store, Loc loc, QualType T = QualType());
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
Store InvalidateRegion(Store store, const MemRegion *R, const Expr *E,
unsigned Count, InvalidatedSymbols *IS);
2009-06-02 13:58:47 -04:00
2009-10-14 14:03:49 -04:00
Store scanForIvars(Stmt *B, const Decl* SelfDecl,
const MemRegion *SelfRegion, Store St);
2010-02-16 04:31:36 -05:00
Store Bind(Store St, Loc loc, SVal V);
2009-06-02 13:58:47 -04:00
Store Remove(Store St, Loc loc);
2009-10-14 14:03:49 -04:00
Store getInitialStore(const LocationContext *InitLoc);
2009-06-02 13:58:47 -04:00
// FIXME: Investigate what is using this. This method should be removed.
2009-10-14 14:03:49 -04:00
virtual Loc getLoc(const VarDecl* VD, const LocationContext *LC) {
return ValMgr.makeLoc(MRMgr.getVarRegion(VD, LC));
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
Store BindCompoundLiteral(Store store, const CompoundLiteralExpr*,
const LocationContext*, SVal val) {
return store;
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
/// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit
/// conversions between arrays and pointers.
SVal ArrayToPointer(Loc Array) { return Array; }
/// RemoveDeadBindings - Scans a BasicStore of 'state' for dead values.
2009-10-14 14:03:49 -04:00
/// It updatees the GRState object in place with the values removed.
2010-02-16 04:31:36 -05:00
Store RemoveDeadBindings(Store store, Stmt* Loc, SymbolReaper& SymReaper,
2009-10-14 14:03:49 -04:00
llvm::SmallVectorImpl<const MemRegion*>& RegionRoots);
2009-06-02 13:58:47 -04:00
void iterBindings(Store store, BindingsHandler& f);
2010-02-16 04:31:36 -05:00
Store BindDecl(Store store, const VarRegion *VR, SVal InitVal) {
return BindDeclInternal(store, VR, &InitVal);
2009-06-02 13:58:47 -04:00
}
2010-02-16 04:31:36 -05:00
Store BindDeclWithNoInit(Store store, const VarRegion *VR) {
return BindDeclInternal(store, VR, 0);
2009-06-02 13:58:47 -04:00
}
2009-11-04 10:04:32 -05:00
Store BindDeclInternal(Store store, const VarRegion *VR, SVal *InitVal);
2009-06-02 13:58:47 -04:00
static inline BindingsTy GetBindings(Store store) {
return BindingsTy(static_cast<const BindingsTy::TreeTy*>(store));
}
2009-06-27 06:45:02 -04:00
void print(Store store, llvm::raw_ostream& Out, const char* nl,
const char *sep);
2009-06-02 13:58:47 -04:00
private:
ASTContext& getContext() { return StateMgr.getContext(); }
};
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
} // end anonymous namespace
StoreManager* clang::CreateBasicStoreManager(GRStateManager& StMgr) {
return new BasicStoreManager(StMgr);
}
static bool isHigherOrderRawPtr(QualType T, ASTContext &C) {
bool foundPointer = false;
2009-10-14 14:03:49 -04:00
while (1) {
const PointerType *PT = T->getAs<PointerType>();
2009-06-02 13:58:47 -04:00
if (!PT) {
if (!foundPointer)
return false;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// intptr_t* or intptr_t**, etc?
if (T->isIntegerType() && C.getTypeSize(T) == C.getTypeSize(C.VoidPtrTy))
return true;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
QualType X = C.getCanonicalType(T).getUnqualifiedType();
return X == C.VoidTy;
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
foundPointer = true;
T = PT->getPointeeType();
2009-10-14 14:03:49 -04:00
}
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
SVal BasicStoreManager::Retrieve(Store store, Loc loc, QualType T) {
2009-06-02 13:58:47 -04:00
if (isa<UnknownVal>(loc))
2010-02-16 04:31:36 -05:00
return UnknownVal();
2009-10-14 14:03:49 -04:00
assert(!isa<UndefinedVal>(loc));
2009-06-02 13:58:47 -04:00
switch (loc.getSubKind()) {
case loc::MemRegionKind: {
const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
2010-02-16 04:31:36 -05:00
return UnknownVal();
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
BindingsTy B = GetBindings(store);
2009-10-14 14:03:49 -04:00
BindingsTy::data_type *Val = B.lookup(R);
if (!Val)
break;
2010-02-16 04:31:36 -05:00
return CastRetrievedVal(*Val, cast<TypedRegion>(R), T);
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
case loc::ConcreteIntKind:
// Some clients may call GetSVal with such an option simply because
// they are doing a quick scan through their Locs (potentially to
// invalidate their bindings). Just return Undefined.
2010-02-16 04:31:36 -05:00
return UndefinedVal();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
default:
assert (false && "Invalid Loc.");
break;
}
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
return UnknownVal();
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
Store BasicStoreManager::Bind(Store store, Loc loc, SVal V) {
2009-07-04 09:58:54 -04:00
if (isa<loc::ConcreteInt>(loc))
return store;
const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();
ASTContext &C = StateMgr.getContext();
2009-10-14 14:03:49 -04:00
2009-07-04 09:58:54 -04:00
// Special case: handle store of pointer values (Loc) to pointers via
// a cast to intXX_t*, void*, etc. This is needed to handle
// OSCompareAndSwap32Barrier/OSCompareAndSwap64Barrier.
if (isa<Loc>(V) || isa<nonloc::LocAsInteger>(V))
if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
// FIXME: Should check for index 0.
QualType T = ER->getLocationType(C);
2009-10-14 14:03:49 -04:00
2009-07-04 09:58:54 -04:00
if (isHigherOrderRawPtr(T, C))
R = ER->getSuperRegion();
2009-10-14 14:03:49 -04:00
}
2009-07-04 09:58:54 -04:00
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
return store;
2009-10-14 14:03:49 -04:00
const TypedRegion *TyR = cast<TypedRegion>(R);
// Do not bind to arrays. We need to explicitly check for this so that
// we do not encounter any weirdness of trying to load/store from arrays.
if (TyR->isBoundable() && TyR->getValueType(C)->isArrayType())
return store;
2009-07-04 09:58:54 -04:00
if (nonloc::LocAsInteger *X = dyn_cast<nonloc::LocAsInteger>(&V)) {
// Only convert 'V' to a location iff the underlying region type
// is a location as well.
// FIXME: We are allowing a store of an arbitrary location to
// a pointer. We may wish to flag a type error here if the types
// are incompatible. This may also cause lots of breakage
// elsewhere. Food for thought.
2009-10-14 14:03:49 -04:00
if (TyR->isBoundable() && Loc::IsLocType(TyR->getValueType(C)))
V = X->getLoc();
2009-06-02 13:58:47 -04:00
}
2009-07-04 09:58:54 -04:00
BindingsTy B = GetBindings(store);
return V.isUnknown()
? VBFactory.Remove(B, R).getRoot()
: VBFactory.Add(B, R, V).getRoot();
2009-06-02 13:58:47 -04:00
}
Store BasicStoreManager::Remove(Store store, Loc loc) {
switch (loc.getSubKind()) {
case loc::MemRegionKind: {
const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
return store;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
return VBFactory.Remove(GetBindings(store), R).getRoot();
}
default:
assert ("Remove for given Loc type not yet implemented.");
return store;
}
}
2010-02-16 04:31:36 -05:00
Store BasicStoreManager::RemoveDeadBindings(Store store, Stmt* Loc,
SymbolReaper& SymReaper,
2009-10-14 14:03:49 -04:00
llvm::SmallVectorImpl<const MemRegion*>& RegionRoots)
2009-06-02 13:58:47 -04:00
{
BindingsTy B = GetBindings(store);
typedef SVal::symbol_iterator symbol_iterator;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Iterate over the variable bindings.
for (BindingsTy::iterator I=B.begin(), E=B.end(); I!=E ; ++I) {
if (const VarRegion *VR = dyn_cast<VarRegion>(I.getKey())) {
2009-12-15 13:49:47 -05:00
if (SymReaper.isLive(Loc, VR))
2009-06-02 13:58:47 -04:00
RegionRoots.push_back(VR);
else
continue;
}
else if (isa<ObjCIvarRegion>(I.getKey())) {
RegionRoots.push_back(I.getKey());
}
else
continue;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Mark the bindings in the data as live.
SVal X = I.getData();
for (symbol_iterator SI=X.symbol_begin(), SE=X.symbol_end(); SI!=SE; ++SI)
SymReaper.markLive(*SI);
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Scan for live variables and live symbols.
llvm::SmallPtrSet<const MemRegion*, 10> Marked;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
while (!RegionRoots.empty()) {
const MemRegion* MR = RegionRoots.back();
RegionRoots.pop_back();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
while (MR) {
if (const SymbolicRegion* SymR = dyn_cast<SymbolicRegion>(MR)) {
SymReaper.markLive(SymR->getSymbol());
break;
}
else if (isa<VarRegion>(MR) || isa<ObjCIvarRegion>(MR)) {
if (Marked.count(MR))
break;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
Marked.insert(MR);
2010-02-16 04:31:36 -05:00
SVal X = Retrieve(store, loc::MemRegionVal(MR));
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: We need to handle symbols nested in region definitions.
for (symbol_iterator SI=X.symbol_begin(),SE=X.symbol_end();SI!=SE;++SI)
SymReaper.markLive(*SI);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (!isa<loc::MemRegionVal>(X))
break;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
const loc::MemRegionVal& LVD = cast<loc::MemRegionVal>(X);
RegionRoots.push_back(LVD.getRegion());
break;
}
else if (const SubRegion* R = dyn_cast<SubRegion>(MR))
MR = R->getSuperRegion();
else
break;
}
}
2009-10-14 14:03:49 -04:00
// Remove dead variable bindings.
2009-06-02 13:58:47 -04:00
for (BindingsTy::iterator I=B.begin(), E=B.end(); I!=E ; ++I) {
const MemRegion* R = I.getKey();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (!Marked.count(R)) {
2009-06-23 10:50:21 -04:00
store = Remove(store, ValMgr.makeLoc(R));
2009-06-02 13:58:47 -04:00
SVal X = I.getData();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
for (symbol_iterator SI=X.symbol_begin(), SE=X.symbol_end(); SI!=SE; ++SI)
SymReaper.maybeDead(*SI);
}
}
2010-02-16 04:31:36 -05:00
return store;
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
Store BasicStoreManager::scanForIvars(Stmt *B, const Decl* SelfDecl,
const MemRegion *SelfRegion, Store St) {
2009-06-02 13:58:47 -04:00
for (Stmt::child_iterator CI=B->child_begin(), CE=B->child_end();
CI != CE; ++CI) {
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (!*CI)
continue;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Check if the statement is an ivar reference. We only
// care about self.ivar.
if (ObjCIvarRefExpr *IV = dyn_cast<ObjCIvarRefExpr>(*CI)) {
const Expr *Base = IV->getBase()->IgnoreParenCasts();
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Base)) {
if (DR->getDecl() == SelfDecl) {
const MemRegion *IVR = MRMgr.getObjCIvarRegion(IV->getDecl(),
2009-10-14 14:03:49 -04:00
SelfRegion);
SVal X = ValMgr.getRegionValueSymbolVal(IVR);
2010-02-16 04:31:36 -05:00
St = Bind(St, ValMgr.makeLoc(IVR), X);
2009-06-02 13:58:47 -04:00
}
}
}
else
2009-10-14 14:03:49 -04:00
St = scanForIvars(*CI, SelfDecl, SelfRegion, St);
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
return St;
}
2009-10-14 14:03:49 -04:00
Store BasicStoreManager::getInitialStore(const LocationContext *InitLoc) {
2009-06-02 13:58:47 -04:00
// The LiveVariables information already has a compilation of all VarDecls
// used in the function. Iterate through this set, and "symbolicate"
// any VarDecl whose value originally comes from outside the function.
typedef LiveVariables::AnalysisDataTy LVDataTy;
2009-10-14 14:03:49 -04:00
LVDataTy& D = InitLoc->getLiveVariables()->getAnalysisData();
2009-06-02 13:58:47 -04:00
Store St = VBFactory.GetEmptyMap().getRoot();
for (LVDataTy::decl_iterator I=D.begin_decl(), E=D.end_decl(); I != E; ++I) {
NamedDecl* ND = const_cast<NamedDecl*>(I->first);
// Handle implicit parameters.
if (ImplicitParamDecl* PD = dyn_cast<ImplicitParamDecl>(ND)) {
2009-10-14 14:03:49 -04:00
const Decl& CD = *InitLoc->getDecl();
2009-06-02 13:58:47 -04:00
if (const ObjCMethodDecl* MD = dyn_cast<ObjCMethodDecl>(&CD)) {
if (MD->getSelfDecl() == PD) {
2010-01-01 05:34:51 -05:00
// FIXME: Add type constraints (when they become available) to
// SelfRegion? (i.e., it implements MD->getClassInterface()).
const MemRegion *VR = MRMgr.getVarRegion(PD, InitLoc);
const MemRegion *SelfRegion =
ValMgr.getRegionValueSymbolVal(VR).getAsRegion();
assert(SelfRegion);
2010-02-16 04:31:36 -05:00
St = Bind(St, ValMgr.makeLoc(VR), loc::MemRegionVal(SelfRegion));
2009-06-02 13:58:47 -04:00
// Scan the method for ivar references. While this requires an
// entire AST scan, the cost should not be high in practice.
2009-10-14 14:03:49 -04:00
St = scanForIvars(MD->getBody(), PD, SelfRegion, St);
2009-06-02 13:58:47 -04:00
}
}
}
else if (VarDecl* VD = dyn_cast<VarDecl>(ND)) {
// Only handle simple types that we can symbolicate.
if (!SymbolManager::canSymbolicate(VD->getType()))
continue;
// Initialize globals and parameters to symbolic values.
// Initialize local variables to undefined.
2009-10-14 14:03:49 -04:00
const MemRegion *R = ValMgr.getRegionManager().getVarRegion(VD, InitLoc);
SVal X = UndefinedVal();
if (R->hasGlobalsOrParametersStorage())
X = ValMgr.getRegionValueSymbolVal(R);
2009-06-02 13:58:47 -04:00
2010-02-16 04:31:36 -05:00
St = Bind(St, ValMgr.makeLoc(R), X);
2009-06-02 13:58:47 -04:00
}
}
return St;
}
2009-11-04 10:04:32 -05:00
Store BasicStoreManager::BindDeclInternal(Store store, const VarRegion* VR,
2009-06-02 13:58:47 -04:00
SVal* InitVal) {
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
BasicValueFactory& BasicVals = StateMgr.getBasicVals();
2009-11-04 10:04:32 -05:00
const VarDecl *VD = VR->getDecl();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// BasicStore does not model arrays and structs.
if (VD->getType()->isArrayType() || VD->getType()->isStructureType())
return store;
if (VD->hasGlobalStorage()) {
// Handle variables with global storage: extern, static, PrivateExtern.
// FIXME:: static variables may have an initializer, but the second time a
// function is called those values may not be current. Currently, a function
// will not be called more than once.
// Static global variables should not be visited here.
assert(!(VD->getStorageClass() == VarDecl::Static &&
VD->isFileVarDecl()));
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Process static variables.
if (VD->getStorageClass() == VarDecl::Static) {
// C99: 6.7.8 Initialization
// If an object that has static storage duration is not initialized
2009-10-14 14:03:49 -04:00
// explicitly, then:
// —if it has pointer type, it is initialized to a null pointer;
// —if it has arithmetic type, it is initialized to (positive or
2009-06-02 13:58:47 -04:00
// unsigned) zero;
if (!InitVal) {
QualType T = VD->getType();
if (Loc::IsLocType(T))
2010-02-16 04:31:36 -05:00
store = Bind(store, loc::MemRegionVal(VR),
2009-06-02 13:58:47 -04:00
loc::ConcreteInt(BasicVals.getValue(0, T)));
else if (T->isIntegerType())
2010-02-16 04:31:36 -05:00
store = Bind(store, loc::MemRegionVal(VR),
2009-06-02 13:58:47 -04:00
nonloc::ConcreteInt(BasicVals.getValue(0, T)));
else {
// assert(0 && "ignore other types of variables");
}
} else {
2010-02-16 04:31:36 -05:00
store = Bind(store, loc::MemRegionVal(VR), *InitVal);
2009-06-02 13:58:47 -04:00
}
}
} else {
// Process local scalar variables.
QualType T = VD->getType();
2009-07-04 09:58:54 -04:00
if (ValMgr.getSymbolManager().canSymbolicate(T)) {
2009-06-02 13:58:47 -04:00
SVal V = InitVal ? *InitVal : UndefinedVal();
2010-02-16 04:31:36 -05:00
store = Bind(store, loc::MemRegionVal(VR), V);
2009-06-02 13:58:47 -04:00
}
}
return store;
}
2009-06-27 06:45:02 -04:00
void BasicStoreManager::print(Store store, llvm::raw_ostream& Out,
2009-06-02 13:58:47 -04:00
const char* nl, const char *sep) {
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
BindingsTy B = GetBindings(store);
Out << "Variables:" << nl;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
bool isFirst = true;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
for (BindingsTy::iterator I=B.begin(), E=B.end(); I != E; ++I) {
2009-06-27 06:45:02 -04:00
if (isFirst)
isFirst = false;
else
Out << nl;
2009-10-14 14:03:49 -04:00
Out << ' ' << I.getKey() << " : " << I.getData();
2009-06-02 13:58:47 -04:00
}
}
void BasicStoreManager::iterBindings(Store store, BindingsHandler& f) {
BindingsTy B = GetBindings(store);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
for (BindingsTy::iterator I=B.begin(), E=B.end(); I != E; ++I)
f.HandleBinding(*this, store, I.getKey(), I.getData());
}
StoreManager::BindingsHandler::~BindingsHandler() {}
2009-10-14 14:03:49 -04:00
//===----------------------------------------------------------------------===//
// Binding invalidation.
//===----------------------------------------------------------------------===//
2010-02-16 04:31:36 -05:00
Store BasicStoreManager::InvalidateRegion(Store store,
const MemRegion *R,
const Expr *E,
unsigned Count,
InvalidatedSymbols *IS) {
2009-11-18 09:59:57 -05:00
R = R->StripCasts();
2009-10-14 14:03:49 -04:00
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
2010-02-16 04:31:36 -05:00
return store;
2009-10-14 14:03:49 -04:00
2009-10-23 10:22:18 -04:00
if (IS) {
2010-02-16 04:31:36 -05:00
BindingsTy B = GetBindings(store);
2009-10-23 10:22:18 -04:00
if (BindingsTy::data_type *Val = B.lookup(R)) {
if (SymbolRef Sym = Val->getAsSymbol())
IS->insert(Sym);
}
}
2009-10-14 14:03:49 -04:00
QualType T = cast<TypedRegion>(R)->getValueType(R->getContext());
SVal V = ValMgr.getConjuredSymbolVal(R, E, T, Count);
2010-02-16 04:31:36 -05:00
return Bind(store, loc::MemRegionVal(R), V);
2009-10-14 14:03:49 -04:00
}