23 using namespace clang;
27 class ObjCAtSyncChecker
28 :
public Checker< check::PreStmt<ObjCAtSynchronizedStmt> > {
29 mutable std::unique_ptr<BuiltinBug> BT_null;
30 mutable std::unique_ptr<BuiltinBug> BT_undef;
48 BT_undef.reset(
new BuiltinBug(
this,
"Uninitialized value used as mutex "
49 "for @synchronized"));
51 llvm::make_unique<BugReport>(*BT_undef, BT_undef->getDescription(), N);
72 this,
"Nil value used as mutex for @synchronized() "
73 "(no synchronization will occur)"));
75 llvm::make_unique<BugReport>(*BT_null, BT_null->getDescription(), N);
ExplodedNode * generateErrorNode(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Generate a transition to a node that will be used to report an error.
ExplodedNode * addTransition(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Generates a new transition in the program state graph (ExplodedGraph).
Defines the Objective-C statement AST node classes.
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
Expr - This represents one expression.
const ProgramStateRef & getState() const
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
Represents Objective-C's @synchronized statement.
ExplodedNode * generateNonFatalErrorNode(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Generate a transition to a node that will be used to report an error.
void emitReport(std::unique_ptr< BugReport > R)
Emit the diagnostics report.
CHECKER * registerChecker()
Used to register checkers.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
const LangOptions & getLangOpts() const
const Expr * getSynchExpr() const
bool trackNullOrUndefValue(const ExplodedNode *N, const Stmt *S, BugReport &R, bool IsArg=false, bool EnableNullFPSuppression=true)
Attempts to add visitors to trace a null or undefined value back to its point of origin, whether it is a symbol constrained to null or an explicit assignment.
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
const LocationContext * getLocationContext() const