27 SVal location = state->getLValue(Ex->
getDecl(), baseVal);
28 Dst.
insert(Engine.makeNodeWithBinding(Pred, Ex, location));
42 if (
const auto *R = dyn_cast<TypedValueRegion>(MV->getRegion())) {
53 V = svalBuilder.makeLoc(Sym);
55 V = svalBuilder.makeIntVal(0,
T);
58 State = State->bindLoc(ElementV,
V, SF);
61 Dst.
insert(Engine.makePostStmtNode(S, State, Pred));
99 if (
const auto *DS = dyn_cast<DeclStmt>(elem)) {
101 assert(elemD->
getInit() ==
nullptr);
103 }
else if (
const auto *Ex = dyn_cast<Expr>(elem)) {
107 bool isContainerNull = state->isNull(collectionV).isConstrainedTrue();
110 evalLocation(DstLocation, S, elem, Pred, state, elementV,
false);
115 if (!isContainerNull)
173 if (Msg->isInstanceMessage()) {
174 SVal recVal = Msg->getReceiverSVal();
182 std::tie(notNilState, nilState) = State->assume(receiverVal);
185 if (nilState && !notNilState) {
187 Pred = Engine.makeNode(PS, nilState, Pred);
194 for (
auto *I : dstPostCheckers)
195 finishArgumentConstruction(Dst, I, *Msg);
201 if (notNilState != State) {
202 Pred = Engine.makePostStmtNode(ME, notNilState, Pred);
224 if (ObjCNoRet.isImplicitNoReturn(ME) &&
225 !(UpdatedMsg->isInstanceMessage() &&
226 UpdatedMsg->getReceiverSVal().isUndef())) {
229 Engine.makePostStmtNode(ME, State, Pred,
true);
238 for (
auto *I : dstEval)
239 finishArgumentConstruction(dstArgCleanup, I, *Msg);
Defines the Objective-C statement AST node classes.
This represents one expression.
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 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 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
Top level wrappers for InstallAPI frontend operations.
const FunctionProtoType * T
U cast(CodeGen::Address addr)