26class ObjCAtSyncChecker
27 :
public Checker< check::PreStmt<ObjCAtSynchronizedStmt> > {
28 const BugType BT_null{
this,
"Nil value used as mutex for @synchronized() "
29 "(no synchronization will occur)"};
30 const BugType BT_undef{
this,
"Uninitialized value used as mutex "
41 const Expr *Ex = S->getSynchExpr();
46 if (isa<UndefinedVal>(
V)) {
48 auto report = std::make_unique<PathSensitiveBugReport>(
49 BT_undef, BT_undef.getDescription(), N);
51 C.emitReport(std::move(report));
61 std::tie(notNullState, nullState) = state->assume(
V.castAs<
DefinedSVal>());
67 if (
ExplodedNode *N =
C.generateNonFatalErrorNode(nullState)) {
68 auto report = std::make_unique<PathSensitiveBugReport>(
69 BT_null, BT_null.getDescription(), N);
72 C.emitReport(std::move(report));
82 C.addTransition(notNullState);
89bool ento::shouldRegisterObjCAtSyncChecker(
const CheckerManager &mgr) {
Defines the Objective-C statement AST node classes.
This represents one expression.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Represents Objective-C's @synchronized statement.
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
const LangOptions & getLangOpts() const
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
bool trackExpressionValue(const ExplodedNode *N, const Expr *E, PathSensitiveBugReport &R, TrackingOptions Opts={})
Attempts to add visitors to track expression value back to its point of origin.
The JSON file list parser is used to communicate input to InstallAPI.