;
26classBoolAssignmentChecker :
public Checker<check::Bind> {
27 const BugTypeBT{
this,
"Assignment of a non-Boolean value"};
29 boolIsTainted =
false)
const;
37 boolIsTainted)
const{
39StringRef Msg = IsTainted ?
"Might assign a tainted non-Boolean value" 40:
"Assignment of a non-Boolean value";
41 C.emitReport(std::make_unique<PathSensitiveBugReport>(BT, Msg, N));
50 returnTT->getDecl()->getName() ==
"BOOL"||
51TT->getDecl()->getName() ==
"_Bool"||
52TT->getDecl()->getName() ==
"Boolean";
57voidBoolAssignmentChecker::checkBind(
SVal Loc,
SValVal,
const Stmt*S,
86llvm::APSInt
Zero= BVF.getValue(0, RegTy);
87llvm::APSInt One = BVF.getValue(1, RegTy);
93emitReport(StOut,
C);
95emitReport(StOut,
C,
true);
102boolento::shouldRegisterBoolAssignmentChecker(
const CheckerManager&Mgr) {
static bool isBooleanType(QualType Ty)
A (possibly-)qualified type.
Stmt - This represents one statement.
bool isBooleanType() const
const T * getAs() const
Member-template getAs<specific type>'.
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
ProgramStatePair assumeInclusiveRangeDual(ProgramStateRef State, NonLoc Value, const llvm::APSInt &From, const llvm::APSInt &To)
Returns a pair of states (StInRange, StOutOfRange) where the given value is assumed to be in the rang...
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.
const MemRegion * getAsRegion() const
TypedValueRegion - An abstract class representing regions having a typed value.
virtual QualType getValueType() const =0
bool isTainted(ProgramStateRef State, const Stmt *S, const LocationContext *LCtx, TaintTagType Kind=TaintTagGeneric)
Check if the statement has a tainted value in the given state.
bool Zero(InterpState &S, CodePtr OpPC)
The JSON file list parser is used to communicate input to InstallAPI.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4