39 SVal LeftV = State->getSVal(LHS, SF);
40 SVal RightV = State->getSVal(RHS, SF);
44 if (Op == BO_Assign) {
53 evalStore(Tmp2, B, LHS, N, State->BindExpr(B, SF, ExprVal), LeftV,
70 ConjureIfNeeded(RightV, LeftV, RHS->
getType());
71 ConjureIfNeeded(LeftV, RightV, LHS->
getType());
78 State = createTemporaryRegionIfNeeded(State, SF, LHS);
84 State = State->BindExpr(B, SF,
Result);
91 Tmp2.
insert(Engine.makePostStmtNode(B, State, N));
99 llvm_unreachable(
"Invalid opcode for compound assignment.");
100 case BO_MulAssign: Op = BO_Mul;
break;
101 case BO_DivAssign: Op = BO_Div;
break;
102 case BO_RemAssign: Op = BO_Rem;
break;
103 case BO_AddAssign: Op = BO_Add;
break;
104 case BO_SubAssign: Op = BO_Sub;
break;
105 case BO_ShlAssign: Op = BO_Shl;
break;
106 case BO_ShrAssign: Op = BO_Shr;
break;
107 case BO_AndAssign: Op = BO_And;
break;
108 case BO_XorAssign: Op = BO_Xor;
break;
109 case BO_OrAssign: Op = BO_Or;
break;
115 evalLoad(Tmp, B, LHS, N, State, LeftV);
118 State = N->getState();
119 SVal V = State->getSVal(LHS, SF);
129 V = svalBuilder.evalCast(
V, CLHSTy, LTy);
141 StoredInLeftV = svalBuilder.conjureSymbolVal(
145 Result = svalBuilder.evalCast(StoredInLeftV, CTy, LTy);
149 StoredInLeftV = svalBuilder.evalCast(
Result, LTy, CTy);
155 State = State->BindExpr(B, SF, LeftV);
157 State = State->BindExpr(B, SF,
Result);
159 evalStore(Tmp2, B, LHS, N, State, LeftV, StoredInLeftV);
164 if (AMgr.options.ShouldEagerlyAssume &&
189 dyn_cast_or_null<BlockDataRegion>(
V.getAsRegion())) {
191 auto ReferencedVars = BDR->referenced_vars();
194 for (
auto Var : ReferencedVars) {
195 const VarRegion *capturedR = Var.getCapturedRegion();
204 const Expr *copyExpr =
nullptr;
206 assert(CI->getVariable() == capturedR->
getDecl());
207 copyExpr = CI->getCopyExpr();
211 if (capturedR != originalR) {
215 originalV = State->getSVal(copyExpr, SF);
224 Dst.
insert(Engine.makeNodeWithBinding(Pred, BE,
V, State,
232 if (T->isLValueReferenceType()) {
235 }
else if (T->isRValueReferenceType()) {
240 SVal OrigV = state->getSVal(Ex, SF);
241 SVal SimplifiedOrigV = svalBuilder.simplifySVal(state, OrigV);
242 SVal V = svalBuilder.evalCast(SimplifiedOrigV, T, ExTy);
244 if (CastE->
getCastKind() == CK_BooleanToSignedIntegral &&
V.isValid())
245 V = svalBuilder.evalMinus(
V.castAs<
NonLoc>());
247 state = state->BindExpr(CastE, SF,
V);
251 Dst.
insert(Engine.makePostStmtNode(CastE, state, Pred));
264 if (CastE->
getCastKind() == CK_LValueToRValueBitCast) {
269 evalLocation(DstEvalLoc, CastE, Ex, Pred, State, State->
getSVal(Ex, SF),
282 if (
const MemRegion *MR = State->getSVal(Ex, SF).getAsRegion()) {
283 SVal OrigV = State->getSVal(MR);
284 CastedV = svalBuilder.evalCast(svalBuilder.simplifySVal(State, OrigV),
287 Dst.
insert(Engine.makeNodeWithBinding(Node, CastE, CastedV));
296 if (
const ExplicitCastExpr *ExCast=dyn_cast_or_null<ExplicitCastExpr>(CastE))
297 T = ExCast->getTypeAsWritten();
300 case CK_LValueToRValue:
301 case CK_LValueToRValueBitCast:
302 llvm_unreachable(
"LValueToRValue casts handled earlier.");
308 case CK_ARCProduceObject:
309 case CK_ARCConsumeObject:
310 case CK_ARCReclaimReturnedObject:
311 case CK_ARCExtendBlockObject:
312 case CK_CopyAndAutoreleaseBlockObject:
316 case CK_AtomicToNonAtomic:
317 case CK_NonAtomicToAtomic:
320 case CK_ConstructorConversion:
321 case CK_UserDefinedConversion:
322 case CK_FunctionToPointerDecay:
323 case CK_BuiltinFnToFnPtr:
324 case CK_HLSLArrayRValue: {
326 SVal V = State->getSVal(Ex, SF);
327 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE,
V));
330 case CK_MemberPointerToBoolean:
331 case CK_PointerToBoolean: {
332 SVal V = State->getSVal(Ex, SF);
335 V = svalBuilder.makeTruthVal(!PTMSV->isNullMemberPointer(), ExTy);
336 if (
V.isUndef() || PTMSV) {
337 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE,
V));
344 case CK_ArrayToPointerDecay:
346 case CK_AddressSpaceConversion:
347 case CK_BooleanToSignedIntegral:
348 case CK_IntegralToPointer:
349 case CK_PointerToIntegral: {
350 SVal V = State->getSVal(Ex, SF);
358 case CK_IntegralToBoolean:
359 case CK_IntegralToFloating:
360 case CK_FloatingToIntegral:
361 case CK_FloatingToBoolean:
362 case CK_FloatingCast:
363 case CK_FloatingRealToComplex:
364 case CK_FloatingComplexToReal:
365 case CK_FloatingComplexToBoolean:
366 case CK_FloatingComplexCast:
367 case CK_FloatingComplexToIntegralComplex:
368 case CK_IntegralRealToComplex:
369 case CK_IntegralComplexToReal:
370 case CK_IntegralComplexToBoolean:
371 case CK_IntegralComplexCast:
372 case CK_IntegralComplexToFloatingComplex:
373 case CK_CPointerToObjCPointerCast:
374 case CK_BlockPointerToObjCPointerCast:
375 case CK_AnyPointerToBlockPointerCast:
376 case CK_ObjCObjectLValueCast:
377 case CK_ZeroToOCLOpaqueType:
378 case CK_IntToOCLSampler:
379 case CK_LValueBitCast:
380 case CK_FloatingToFixedPoint:
381 case CK_FixedPointToFloating:
382 case CK_FixedPointCast:
383 case CK_FixedPointToBoolean:
384 case CK_FixedPointToIntegral:
385 case CK_IntegralToFixedPoint: {
389 case CK_IntegralCast: {
391 SVal V = State->getSVal(Ex, SF);
392 if (AMgr.options.analyzerSymbolicIntegerCasts())
393 V = svalBuilder.evalCast(
V, T, ExTy);
395 V = svalBuilder.evalIntegralCast(State,
V, T, ExTy);
396 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE,
V));
399 case CK_DerivedToBase:
400 case CK_UncheckedDerivedToBase: {
402 SVal val = State->getSVal(Ex, SF);
404 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE, val));
409 SVal val = State->getSVal(Ex, SF);
420 if (std::optional<SVal>
V =
421 StateMgr.getStoreManager().evalBaseToDerived(val, T)) {
427 if (T->isReferenceType()) {
430 Engine.makePostStmtNode(CastE, State, Pred,
true);
434 State = State->BindExpr(CastE, SF,
435 svalBuilder.makeNullWithType(resultType));
443 State = State->BindExpr(CastE, SF, NewSym);
446 State = State->BindExpr(CastE, SF, val);
448 Dst.
insert(Engine.makePostStmtNode(CastE, State, Pred));
451 case CK_BaseToDerived: {
452 SVal val = State->getSVal(Ex, SF);
464 val = svalBuilder.conjureSymbolVal(
468 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE, val));
471 case CK_NullToPointer: {
472 SVal V = svalBuilder.makeNullWithType(CastE->
getType());
473 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE,
V));
476 case CK_NullToMemberPointer: {
477 SVal V = svalBuilder.getMemberPointer(
nullptr);
478 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE,
V));
481 case CK_DerivedToBaseMemberPointer:
482 case CK_BaseToDerivedMemberPointer:
483 case CK_ReinterpretMemberPointer: {
484 SVal V = State->getSVal(Ex, SF);
487 svalBuilder.makePointerToMember(
getBasicVals().accumCXXBase(
489 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE, CastedPTMSV));
498 case CK_CoopMatrixCast:
500 case CK_HLSLElementwiseCast:
501 case CK_HLSLAggregateSplatCast:
502 case CK_HLSLMatrixTruncation:
503 case CK_HLSLVectorTruncation: {
507 SVal result = svalBuilder.conjureSymbolVal(
510 Dst.
insert(Engine.makeNodeWithBinding(Pred, CastE, result));
523 SVal V = State->getSVal(
CL->getInitializer(), SF);
529 Loc CLLoc = State->getLValue(
CL, SF);
530 State = State->bindLoc(CLLoc,
V, SF);
536 Dst.
insert(Engine.makeNodeWithBinding(Pred,
CL,
V, State));
570 if (
const auto *IL = dyn_cast<InitListExpr>(EI);
571 IL && IL->getNumInits() == 1)
575 if (
const auto *DR = dyn_cast<DeclRefExpr>(EI->IgnoreParenImpCasts())) {
599 SVal InitVal = state->getSVal(InitEx, SF);
603 state = finishObjectConstruction(state, DS, SF);
606 dstEvaluated.
insert(Engine.makePostStmtNode(DS, state, UpdatedN));
612 if (InitEx->isGLValue()) {
616 InitVal = svalBuilder.conjureSymbolVal(
621 evalBind(dstEvaluated, DS, UpdatedN, state->getLValue(VD, SF), InitVal,
626 dstEvaluated.
insert(Engine.makePostStmtNode(DS, state, N));
661 Dst.
insert(Engine.makePostStmtNode(B, state, Pred));
673 Dst.
insert(Engine.makePostStmtNode(B, state, Pred));
681 Dst.
insert(Engine.makePostStmtNode(B, state, Pred));
694 if (
const BinaryOperator *Term = cast_or_null<BinaryOperator>(T.getStmt())) {
696 assert(Term->isLogicalOp());
700 X = svalBuilder.makeIntVal(constant, B->
getType());
706 assert(!SrcBlock->
empty());
718 svalBuilder.makeZeroVal(RHS->getType()), B->
getType());
721 Dst.
insert(Engine.makeNodeWithBinding(Pred, B,
X));
738 auto Edge = N->getLocationAs<
BlockEdge>();
739 if (!Edge.has_value()) {
747 SrcBlock = Edge->getSrc();
748 SrcState = N->getState();
752 assert(SrcBlock &&
"missing function entry");
756 bool hasValue =
false;
759 for (
CFGElement CE : llvm::reverse(*SrcBlock)) {
760 if (std::optional<CFGStmt> CS = CE.getAs<
CFGStmt>()) {
767 L = OpaqueEx->getSourceExpr();
771 if (ValEx == L->
IgnoreParens() || ValEx == R->IgnoreParens()) {
773 V = SrcState->getSVal(ValEx, SF);
784 Dst.
insert(Engine.makeNodeWithBinding(Pred, Ex,
V));
791 APSInt IV =
Result.Val.getInt();
795 SVal X = svalBuilder.makeIntVal(IV);
796 Dst.
insert(Engine.makeNodeWithBinding(Pred, OOE,
X));
808 if (Ex->
getKind() == UETT_SizeOf || Ex->
getKind() == UETT_DataSizeOf ||
809 Ex->
getKind() == UETT_CountOf) {
810 if (!T->isIncompleteType() && !T->isConstantSizeType()) {
811 assert(T->isVariableArrayType() &&
"Unknown non-constant-sized type.");
830 Dst.
insert(Engine.makeNodeWithBinding(Pred, Ex,
V));
838 "Empty statement expression must have void type.");
839 }
else if (
const auto *LastExpr =
842 Pred = Engine.makeNodeWithBinding(Pred, SE, Val);
856 auto MakeNodeForIdentityOp = [
U, &Engine = Engine](
ExplodedNode *N) {
857 const Expr *Ex =
U->getSubExpr()->IgnoreParens();
858 SVal SV = N->getState()->getSVal(Ex, N->getStackFrame());
859 return Engine.makeNodeWithBinding(N,
U, SV);
863 switch (
U->getOpcode()) {
871 const Expr *Ex =
U->getSubExpr()->IgnoreParens();
881 assert (
U->getType() == Ex->
getType());
882 EvalSet.
insert(MakeNodeForIdentityOp(N));
887 const Expr *Ex =
U->getSubExpr()->IgnoreParens();
896 EvalSet.
insert(Engine.makeNodeWithBinding(N,
U,
X));
902 const Expr *Ex =
U->getSubExpr()->IgnoreParens();
903 if (
const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Ex)) {
908 EvalSet.
insert(Engine.makeNodeWithBinding(N,
U, SV));
913 EvalSet.
insert(MakeNodeForIdentityOp(N));
917 assert(!
U->isGLValue());
921 EvalSet.
insert(MakeNodeForIdentityOp(N));
928 assert (!
U->isGLValue());
929 const Expr *Ex =
U->getSubExpr()->IgnoreParens();
934 SVal V = state->getSVal(Ex, SF);
936 if (
V.isUnknownOrUndef()) {
937 EvalSet.
insert(Engine.makeNodeWithBinding(N,
U,
V));
941 switch (
U->getOpcode()) {
943 llvm_unreachable(
"Invalid Opcode.");
946 state = state->BindExpr(
947 U, SF, svalBuilder.evalComplement(
V.castAs<
NonLoc>()));
952 state->BindExpr(
U, SF, svalBuilder.evalMinus(
V.castAs<
NonLoc>()));
960 if (std::optional<Loc> LV =
V.getAs<
Loc>()) {
961 Loc X = svalBuilder.makeNullWithType(Ex->
getType());
971 state = state->BindExpr(
U, SF,
Result);
974 EvalSet.
insert(Engine.makePostStmtNode(
U, state, N));
981 if (AMgr.options.ShouldEagerlyAssume && (
U->getOpcode() == UO_LNot)) {
984 AssumedSet.
insert(EvalSet);
995 Dst.
insert(Engine.makeNodeWithBinding(Pred, PE,
V));
1006 Dst.
insert(Engine.makeNodeWithBinding(Pred, OIE,
V));
1013 assert (
U->isIncrementDecrementOp());
1014 const Expr *Ex =
U->getSubExpr()->IgnoreParens();
1018 SVal loc = state->getSVal(Ex, SF);
1026 state = N->getState();
1027 assert(SF == N->getStackFrame());
1028 SVal V2_untested = state->getSVal(Ex, SF);
1032 state = state->BindExpr(
U, SF, V2_untested);
1049 if (
U->getType()->isAnyPointerType())
1050 RHS = svalBuilder.makeArrayIndex(1);
1051 else if (
U->getType()->isIntegralOrEnumerationType())
1052 RHS = svalBuilder.makeIntVal(1,
U->getType());
1060 if (
U->getType()->isBooleanType() &&
U->isIncrementOp())
1061 Result = svalBuilder.makeTruthVal(
true,
U->getType());
1077 svalBuilder.evalEQ(state, V2,svalBuilder.makeZeroVal(
U->getType()));
1079 if (!state->assume(Constraint,
true)) {
1082 Constraint = svalBuilder.evalEQ(state, SymVal,
1083 svalBuilder.makeZeroVal(
U->getType()));
1085 state = state->assume(Constraint,
false);
1094 state = state->BindExpr(
U, SF,
loc);
1096 state = state->BindExpr(
U, SF,
U->isPostfix() ? V2 :
Result);
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::Expr interface and subclasses for C++ expressions.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
static CanQualType getCanonicalType(QualType T)
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
A builtin binary operation expression such as "x + y" or "x <= y".
static bool isRelationalOp(Opcode Opc)
static bool isAdditiveOp(Opcode Opc)
static bool isAssignmentOp(Opcode Opc)
static bool isCompoundAssignmentOp(Opcode Opc)
static bool isEqualityOp(Opcode Opc)
BinaryOperatorKind Opcode
Represents a block literal declaration, which is like an unnamed FunctionDecl.
capture_const_iterator capture_begin() const
capture_const_iterator capture_end() const
const CFGBlock * getSrc() const
const CFGBlock * getDst() const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
const BlockDecl * getBlockDecl() const
This class is used for builtin types like 'int'.
Represents a single basic block in a source-level CFG.
reverse_iterator rbegin()
CFGTerminator getTerminator() const
succ_iterator succ_begin()
unsigned succ_size() const
Represents a top-level expression in a basic block.
T castAs() const
Convert to the specified CFGElement type, asserting that this CFGElement is of the desired type.
const Stmt * getStmt() const
Represents CFGBlock terminator statement.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
CastKind getCastKind() const
llvm::iterator_range< path_iterator > path()
Path through the class hierarchy taken by casts between base and derived classes (see implementation ...
This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
Get the raw integer representation of this quantity.
static constexpr CharUnits fromQuantity(QuantityType Quantity)
Construct a CharUnits quantity from a raw integer type.
CompoundLiteralExpr - [C99 6.5.2.5].
reverse_body_iterator body_rbegin()
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
bool isSingleDecl() const
isSingleDecl - This method returns true if this DeclStmt refers to a single Decl.
decl_iterator decl_begin()
ExplicitCastExpr - An explicit cast written in the source code.
This represents one expression.
bool EvaluateAsInt(EvalResult &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects, bool InConstantContext=false) const
EvaluateAsInt - Return true if this is a constant which we can fold and convert to an integer,...
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx) const
EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded integer.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Represents a point after we ran remove dead bindings BEFORE processing the given statement.
T castAs() const
Convert to the specified ProgramPoint type, asserting that this ProgramPoint is of the desired type.
std::optional< T > getAs() const
Convert to the specified ProgramPoint type, returning std::nullopt if this ProgramPoint is not of the...
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Expr * getResultExpr()
Return the result-bearing expression, or null if there is none.
A (possibly-)qualified type.
It represents a stack frame of the call stack.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
CompoundStmt * getSubStmt()
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
bool isRValueReferenceType() const
const T * castAs() const
Member-template castAs<specific type>.
bool isReferenceType() const
bool isLValueReferenceType() const
bool isAnyComplexType() const
bool isVectorType() const
bool isFloatingType() const
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
QualType getTypeOfArgument() const
Gets the argument type, or the type of the argument expression, whichever is appropriate.
UnaryExprOrTypeTrait getKind() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
const Expr * getInit() const
BlockDataRegion - A region that represents a block instance.
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.
ExplodedNodeSet is a set of ExplodedNode * elements with the invariant that its elements cannot be nu...
void insert(ExplodedNode *N)
ImplTy::iterator iterator
const ProgramStateRef & getState() const
pred_iterator pred_begin()
SVal getSVal(const Expr *E) const
Get the value of an arbitrary expression at this node.
ProgramPoint getLocation() const
getLocation - Returns the edge associated with the given node.
unsigned pred_size() const
const StackFrame * getStackFrame() const
void VisitBinaryOperator(const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitBinaryOperator - Transfer function logic for binary operators.
void VisitGuardedExpr(const Expr *Ex, const Expr *L, const Expr *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitGuardedExpr - Transfer function logic for ?, __builtin_choose.
BasicValueFactory & getBasicVals()
void VisitLogicalExpr(const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitLogicalExpr - Transfer function logic for '&&', '||'.
void evalEagerlyAssumeBifurcation(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, const Expr *Ex)
evalEagerlyAssumeBifurcation - Given the nodes in 'Src', eagerly assume concrete boolean values for '...
SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, SVal LHS, SVal RHS, QualType T)
void VisitObjCIndirectCopyRestoreExpr(const ObjCIndirectCopyRestoreExpr *OIE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitUnaryOperator(const UnaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitUnaryOperator - Transfer function logic for unary operators.
void VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitDeclStmt - Transfer function logic for DeclStmts.
void VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitBlockExpr - Transfer function logic for BlockExprs.
void VisitIncrementDecrementOperator(const UnaryOperator *U, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Handle ++ and – (both pre- and post-increment).
ASTContext & getContext() const
getContext - Return the ASTContext associated with this analysis.
StoreManager & getStoreManager()
ConstCFGElementRef getCFGElementRef() const
If the current analysis step is the analysis of a CFGElement, return a reference to it; otherwise ret...
void VisitStmtExpr(const StmtExpr *SE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof.
ProgramStateRef escapeValues(ProgramStateRef State, ArrayRef< SVal > Vs, PointerEscapeKind K, const CallEvent *Call=nullptr) const
A simple wrapper when you only need to notify checkers of pointer-escape of some values.
CheckerManager & getCheckerManager() const
static std::optional< SVal > getObjectUnderConstruction(ProgramStateRef State, const ConstructionContextItem &Item, const StackFrame *SF)
By looking at a certain item that may be potentially part of an object's ConstructionContext,...
unsigned getNumVisitedCurrent() const
void VisitOffsetOfExpr(const OffsetOfExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitOffsetOfExpr - Transfer function for offsetof.
void evalLoad(ExplodedNodeSet &Dst, const Expr *NodeEx, const Expr *BoundExpr, ExplodedNode *Pred, ProgramStateRef St, SVal location, const ProgramPointTag *tag=nullptr, QualType LoadTy=QualType())
Simulate a read of the result of Ex.
void VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitCompoundLiteralExpr - Transfer function logic for compound literals.
void evalStore(ExplodedNodeSet &Dst, const Expr *AssignE, const Expr *StoreE, ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val, const ProgramPointTag *tag=nullptr)
evalStore - Handle the semantics of a store via an assignment.
void VisitCastExpr(const CastExpr *CastE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitCastExpr - Transfer function logic for all casts (implicit and explicit).
void VisitPseudoObjectExpr(const PseudoObjectExpr *PE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void handleLValueBitCast(ProgramStateRef state, const Expr *Ex, const StackFrame *SF, QualType T, QualType ExTy, const CastExpr *CastE, ExplodedNodeSet &Dst, ExplodedNode *Pred)
static bool isLocType(QualType T)
MemRegion - The root abstract class for all memory regions.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
bool isZeroConstant() const
bool isUnknownOrUndef() const
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
SVal evalDerivedToBase(SVal Derived, const CastExpr *Cast)
Evaluates a chain of derived-to-base casts through the path specified in Cast.
std::optional< SVal > evalBaseToDerived(SVal Base, QualType DerivedPtrType)
Attempts to do a down cast.
TypedValueRegion - An abstract class representing regions having a typed value.
const VarDecl * getDecl() const override=0
Value representing integer constant.
Value representing pointer-to-member.
@ PSK_EscapeOther
The reason for pointer escape is unknown.
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
Top level wrappers for InstallAPI frontend operations.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
bool isa(CodeGen::Address addr)
@ Result
The result type of a method or function.
U cast(CodeGen::Address addr)
EvalResult is a struct with detailed info about an evaluated expression.