|
@@ -254,7 +254,7 @@ ExprEngine::createTemporaryRegionIfNeeded(ProgramStateRef State,
|
|
|
break;
|
|
|
case SubobjectAdjustment::MemberPointerAdjustment:
|
|
|
// FIXME: Unimplemented.
|
|
|
- State->bindDefault(Reg, UnknownVal());
|
|
|
+ State->bindDefault(Reg, UnknownVal(), LC);
|
|
|
return State;
|
|
|
}
|
|
|
}
|
|
@@ -265,7 +265,7 @@ ExprEngine::createTemporaryRegionIfNeeded(ProgramStateRef State,
|
|
|
currBldrCtx->blockCount());
|
|
|
// Bind the value of the expression to the sub-object region, and then bind
|
|
|
// the sub-object region to our expression.
|
|
|
- State = State->bindLoc(Reg, V);
|
|
|
+ State = State->bindLoc(Reg, V, LC);
|
|
|
State = State->BindExpr(Result, LC, Reg);
|
|
|
return State;
|
|
|
}
|
|
@@ -286,9 +286,11 @@ ExprEngine::processRegionChanges(ProgramStateRef state,
|
|
|
const InvalidatedSymbols *invalidated,
|
|
|
ArrayRef<const MemRegion *> Explicits,
|
|
|
ArrayRef<const MemRegion *> Regions,
|
|
|
+ const LocationContext *LCtx,
|
|
|
const CallEvent *Call) {
|
|
|
return getCheckerManager().runCheckersForRegionChanges(state, invalidated,
|
|
|
- Explicits, Regions, Call);
|
|
|
+ Explicits, Regions,
|
|
|
+ LCtx, Call);
|
|
|
}
|
|
|
|
|
|
void ExprEngine::printState(raw_ostream &Out, ProgramStateRef State,
|
|
@@ -2165,7 +2167,9 @@ public:
|
|
|
// (3) We are binding to a MemRegion with stack storage that the store
|
|
|
// does not understand.
|
|
|
ProgramStateRef ExprEngine::processPointerEscapedOnBind(ProgramStateRef State,
|
|
|
- SVal Loc, SVal Val) {
|
|
|
+ SVal Loc,
|
|
|
+ SVal Val,
|
|
|
+ const LocationContext *LCtx) {
|
|
|
// Are we storing to something that causes the value to "escape"?
|
|
|
bool escapes = true;
|
|
|
|
|
@@ -2181,7 +2185,7 @@ ProgramStateRef ExprEngine::processPointerEscapedOnBind(ProgramStateRef State,
|
|
|
// same state.
|
|
|
SVal StoredVal = State->getSVal(regionLoc->getRegion());
|
|
|
if (StoredVal != Val)
|
|
|
- escapes = (State == (State->bindLoc(*regionLoc, Val)));
|
|
|
+ escapes = (State == (State->bindLoc(*regionLoc, Val, LCtx)));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2278,7 +2282,7 @@ void ExprEngine::evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE,
|
|
|
const ProgramPoint L = PostStore(StoreE, LC, /*Loc*/nullptr,
|
|
|
/*tag*/nullptr);
|
|
|
ProgramStateRef state = Pred->getState();
|
|
|
- state = processPointerEscapedOnBind(state, location, Val);
|
|
|
+ state = processPointerEscapedOnBind(state, location, Val, LC);
|
|
|
Bldr.generateNode(L, state, Pred);
|
|
|
return;
|
|
|
}
|
|
@@ -2288,13 +2292,13 @@ void ExprEngine::evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE,
|
|
|
ExplodedNode *PredI = *I;
|
|
|
ProgramStateRef state = PredI->getState();
|
|
|
|
|
|
- state = processPointerEscapedOnBind(state, location, Val);
|
|
|
+ state = processPointerEscapedOnBind(state, location, Val, LC);
|
|
|
|
|
|
// When binding the value, pass on the hint that this is a initialization.
|
|
|
// For initializations, we do not need to inform clients of region
|
|
|
// changes.
|
|
|
state = state->bindLoc(location.castAs<Loc>(),
|
|
|
- Val, /* notifyChanges = */ !atDeclInit);
|
|
|
+ Val, LC, /* notifyChanges = */ !atDeclInit);
|
|
|
|
|
|
const MemRegion *LocReg = nullptr;
|
|
|
if (Optional<loc::MemRegionVal> LocRegVal =
|
|
@@ -2520,7 +2524,7 @@ void ExprEngine::VisitGCCAsmStmt(const GCCAsmStmt *A, ExplodedNode *Pred,
|
|
|
assert (!X.getAs<NonLoc>()); // Should be an Lval, or unknown, undef.
|
|
|
|
|
|
if (Optional<Loc> LV = X.getAs<Loc>())
|
|
|
- state = state->bindLoc(*LV, UnknownVal());
|
|
|
+ state = state->bindLoc(*LV, UnknownVal(), Pred->getLocationContext());
|
|
|
}
|
|
|
|
|
|
Bldr.generateNode(A, Pred, state);
|