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);
52 bugreporter::trackNullOrUndefValue(N, Ex, *report);
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);
76 bugreporter::trackNullOrUndefValue(N, Ex, *report);
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.
SVal getSVal(const Stmt *S) const
Get the value of arbitrary expressions at this point in the path.
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.
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.
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
CHECKER * registerChecker(AT... Args)
Used to register checkers.
void emitReport(std::unique_ptr< BugReport > R)
Emit the diagnostics report.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
Dataflow Directional Tag Classes.
const Expr * getSynchExpr() const
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
const ProgramStateRef & getState() const
const LangOptions & getLangOpts() const