27 SVal location = state->getLValue(Ex->
getDecl(), baseVal);
29 ExplodedNode *N = Engine.makeNodeWithBinding(Pred, Ex, location);
53 if (
const auto *R = dyn_cast<TypedValueRegion>(MV->getRegion())) {
64 V = svalBuilder.makeLoc(Sym);
66 V = svalBuilder.makeIntVal(0, T);
69 State = State->bindLoc(ElementV,
V, SF);
72 Dst.
insert(Engine.makePostStmtNode(S, State, Pred));
110 if (
const auto *DS = dyn_cast<DeclStmt>(elem)) {
112 assert(elemD->
getInit() ==
nullptr);
114 }
else if (
const auto *Ex = dyn_cast<Expr>(elem)) {
118 bool isContainerNull = state->isNull(collectionV).isConstrainedTrue();
121 evalLocation(DstLocation, S, elem, Pred, state, elementV,
false);
126 if (!isContainerNull)
186 if (Msg->isInstanceMessage()) {
187 SVal recVal = Msg->getReceiverSVal();
195 std::tie(notNilState, nilState) = State->assume(receiverVal);
198 if (nilState && !notNilState) {
200 Pred = Engine.makeNode(PS, nilState, Pred);
207 for (
auto *I : dstPostCheckers)
208 finishArgumentConstruction(Dst, I, *Msg);
214 if (notNilState != State) {
215 Pred = Engine.makePostStmtNode(ME, notNilState, Pred);
237 if (ObjCNoRet.isImplicitNoReturn(ME) &&
238 !(UpdatedMsg->isInstanceMessage() &&
239 UpdatedMsg->getReceiverSVal().isUndef())) {
242 Engine.makePostStmtNode(ME, State, Pred,
true);
251 for (
auto *I : dstEval)
252 finishArgumentConstruction(dstArgCleanup, I, *Msg);
Defines the Objective-C statement AST node classes.
This represents one expression.
Represents Objective-C's @synchronized statement.
Represents Objective-C's collection statement.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
const Expr * getBase() const
An expression that sends a message to the given Objective-C object or class.
A (possibly-)qualified type.
It represents a stack frame of the call stack.
Stmt - This represents one statement.
Represents a variable declaration or definition.
const Expr * getInit() const
Manages the lifetime of CallEvent objects.
CallEventRef< ObjCMethodCall > getObjCMethodCall(const ObjCMessageExpr *E, ProgramStateRef State, const StackFrame *SF, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< T > cloneWithState(ProgramStateRef State) const
void runCheckersForPreObjCMessage(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng)
Run checkers for pre-visiting obj-c messages.
void runCheckersForPreCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng)
Run checkers for pre-visiting function calls (including methods, constructors, destructors etc.
void runCheckersForPostObjCMessage(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting obj-c messages.
void runCheckersForPostStmt(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting Stmts.
void runCheckersForPreStmt(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng)
Run checkers for pre-visiting Stmts.
void runCheckersForObjCMessageNil(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng)
Run checkers for visiting an obj-c message to nil.
void runCheckersForPostCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false)
Run checkers for post-visiting function calls (including methods, constructors, destructors etc.
ExplodedNodeSet is a set of ExplodedNode * elements with the invariant that its elements cannot be nu...
void insert(ExplodedNode *N)
const ProgramStateRef & getState() const
const StackFrame * getStackFrame() const
ProgramStateManager & getStateManager()
void VisitObjCMessage(const ObjCMessageExpr *ME, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for ObjCAtSynchronizedStmts.
void VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitObjCForCollectionStmt - Transfer function logic for ObjCForCollectionStmt.
void VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr *DR, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for computing the lvalue of an Objective-C ivar.
void defaultEvalCall(ExplodedNodeSet &Dst, ExplodedNode *Pred, const CallEvent &Call, const EvalCallOptions &CallOpts={})
Default implementation of call evaluation.
ConstCFGElementRef getCFGElementRef() const
void populateObjCForDestinationSet(const ObjCForCollectionStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst, SVal ElementV, bool HasElements)
Implementation detail of VisitObjCForCollectionStmt, which contains the logic that needs to be execut...
static ProgramStateRef setWhetherHasMoreIteration(ProgramStateRef State, const ObjCForCollectionStmt *O, const StackFrame *SF, bool HasMoreIteraton)
Note whether this loop has any more iterations to model. These methods.
CheckerManager & getCheckerManager() const
unsigned getNumVisitedCurrent() const
static bool isLocType(QualType T)
CallEventManager & getCallEventManager()
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
std::optional< T > getAs() const
Convert to the specified SVal type, returning std::nullopt if this SVal is not of the desired type.
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
const SymExpr * SymbolRef
The JSON file list parser is used to communicate input to InstallAPI.
U cast(CodeGen::Address addr)