18 using namespace clang;
27 SVal location = state->getLValue(Ex->
getDecl(), baseVal);
31 Bldr.
generateNode(Ex, Pred, state->BindExpr(Ex, LCtx, location));
47 ExplodedNodeSet &dstLocation, SValBuilder &svalBuilder,
49 SymbolManager &SymMgr,
const NodeBuilderContext *currBldrCtx,
50 StmtNodeBuilder &Bldr,
bool hasElements) {
52 for (ExplodedNode *Pred : dstLocation) {
56 SVal hasElementsV = svalBuilder.makeTruthVal(hasElements);
61 if (
auto MV = elementV.getAs<loc::MemRegionVal>())
62 if (
const auto *R = dyn_cast<TypedValueRegion>(MV->getRegion())) {
71 SymbolRef Sym = SymMgr.conjureSymbol(elem, LCtx, T,
72 currBldrCtx->blockCount());
73 V = svalBuilder.makeLoc(Sym);
75 V = svalBuilder.makeIntVal(0, T);
78 nextState = nextState->bindLoc(elementV, V, LCtx);
81 Bldr.generateNode(S, Pred, nextState);
120 if (
const auto *DS = dyn_cast<DeclStmt>(elem)) {
121 const VarDecl *elemD = cast<VarDecl>(DS->getSingleDecl());
122 assert(elemD->
getInit() ==
nullptr);
128 bool isContainerNull = state->isNull(collectionV).isConstrainedTrue();
131 evalLocation(dstLocation, S, elem, Pred, state, elementV,
false);
136 if (!isContainerNull)
138 SymMgr, currBldrCtx, Bldr,
142 SymMgr, currBldrCtx, Bldr,
186 if (Msg->isInstanceMessage()) {
187 SVal recVal = Msg->getReceiverSVal();
195 std::tie(notNilState, nilState) = State->assume(receiverVal);
198 if (nilState && !notNilState) {
204 assert((Pred || HasTag) &&
"Should have cached out already!");
212 for (
auto I : dstPostCheckers)
213 finishArgumentConstruction(Dst, I, *Msg);
221 if (notNilState != State) {
224 assert((Pred || HasTag) &&
"Should have cached out already!");
245 DE = dstGenericPrevisit.
end(); DI != DE; ++DI) {
250 if (UpdatedMsg->isInstanceMessage()) {
251 SVal recVal = UpdatedMsg->getReceiverSVal();
276 for (
auto I : dstEval)
277 finishArgumentConstruction(dstArgCleanup, I, *Msg);
A (possibly-)qualified type.
ImplTy::iterator iterator
Stmt - This represents one statement.
This builder class is useful for generating nodes that resulted from visiting a statement.
Manages the lifetime of CallEvent objects.
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
const ProgramStateRef & getState() const
Represents a variable declaration or definition.
Defines the Objective-C statement AST node classes.
const SymExpr * SymbolRef
void runCheckersForObjCMessageNil(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng)
Run checkers for visiting an obj-c message to nil.
static void populateObjCForDestinationSet(ExplodedNodeSet &dstLocation, SValBuilder &svalBuilder, const ObjCForCollectionStmt *S, const Stmt *elem, SVal elementV, SymbolManager &SymMgr, const NodeBuilderContext *currBldrCtx, StmtNodeBuilder &Bldr, bool hasElements)
Generate a node in Bldr for an iteration statement using ObjC for-loop iterator.
void runCheckersForPostObjCMessage(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting obj-c messages.
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
static bool isLocType(QualType T)
ExplodedNode * generateSink(const Stmt *S, ExplodedNode *Pred, ProgramStateRef St, const ProgramPointTag *tag=nullptr, ProgramPoint::Kind K=ProgramPoint::PostStmtKind)
void runCheckersForPreCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng)
Run checkers for pre-visiting obj-c messages.
const LocationContext * getLocationContext() const
void runCheckersForPostCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting obj-c messages.
CheckerManager & getCheckerManager() const
void runCheckersForPostStmt(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting Stmts.
void VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr *DR, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for computing the lvalue of an Objective-C ivar.
void runCheckersForPreObjCMessage(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng)
Run checkers for pre-visiting obj-c messages.
Represents Objective-C's @synchronized statement.
An expression that sends a message to the given Objective-C object or class.
CallEventRef< ObjCMethodCall > getObjCMethodCall(const ObjCMessageExpr *E, ProgramStateRef State, const LocationContext *LCtx)
CallEventManager & getCallEventManager()
ProgramPoint getLocation() const
getLocation - Returns the edge associated with the given node.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
void VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitObjCForCollectionStmt - Transfer function logic for ObjCForCollectionStmt.
void runCheckersForPreStmt(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng)
Run checkers for pre-visiting Stmts.
Dataflow Directional Tag Classes.
const Expr * getInit() const
const ProgramPointTag * getTag() const
ProgramStateManager & getStateManager() override
void defaultEvalCall(NodeBuilder &B, ExplodedNode *Pred, const CallEvent &Call, const EvalCallOptions &CallOpts={})
Default implementation of call evaluation.
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
bool isImplicitNoReturn(const ObjCMessageExpr *ME)
Return true if the given message expression is known to never return.
Represents Objective-C's collection statement.
void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for ObjCAtSynchronizedStmts.
void VisitObjCMessage(const ObjCMessageExpr *ME, ExplodedNode *Pred, ExplodedNodeSet &Dst)
const Expr * getBase() const
ObjCIvarRefExpr - A reference to an ObjC instance variable.
ExplodedNode * generateNode(const Stmt *S, ExplodedNode *Pred, ProgramStateRef St, const ProgramPointTag *tag=nullptr, ProgramPoint::Kind K=ProgramPoint::PostStmtKind)
CallEventRef< T > cloneWithState(ProgramStateRef State) const