зеркало из https://github.com/microsoft/clang-1.git
[analyzer] Rename 'EmitReport' to 'emitReport'.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167275 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
80a8eb76a0
Коммит
785950e594
|
@ -450,7 +450,7 @@ public:
|
|||
/// The reports are usually generated by the checkers. Further, they are
|
||||
/// folded based on the profile value, which is done to coalesce similar
|
||||
/// reports.
|
||||
void EmitReport(BugReport *R);
|
||||
void emitReport(BugReport *R);
|
||||
|
||||
void EmitBasicReport(const Decl *DeclWithIssue,
|
||||
StringRef BugName, StringRef BugCategory,
|
||||
|
|
|
@ -202,9 +202,9 @@ public:
|
|||
}
|
||||
|
||||
/// \brief Emit the diagnostics report.
|
||||
void EmitReport(BugReport *R) {
|
||||
void emitReport(BugReport *R) {
|
||||
Changed = true;
|
||||
Eng.getBugReporter().EmitReport(R);
|
||||
Eng.getBugReporter().emitReport(R);
|
||||
}
|
||||
|
||||
/// \brief Get the declaration of the called function (path-sensitive).
|
||||
|
|
|
@ -78,7 +78,7 @@ void ArrayBoundChecker::checkLocation(SVal l, bool isLoad, const Stmt* LoadS,
|
|||
new BugReport(*BT, BT->getDescription(), N);
|
||||
|
||||
report->addRange(LoadS->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void ArrayBoundCheckerV2::reportOOB(CheckerContext &checkerContext,
|
|||
break;
|
||||
}
|
||||
|
||||
checkerContext.EmitReport(new BugReport(*BT, os.str(), errorNode));
|
||||
checkerContext.emitReport(new BugReport(*BT, os.str(), errorNode));
|
||||
}
|
||||
|
||||
void RegionRawOffsetV2::dump() const {
|
||||
|
|
|
@ -107,7 +107,7 @@ void AttrNonNullChecker::checkPreCall(const CallEvent &Call,
|
|||
if (const Expr *ArgE = Call.getArgExpr(idx))
|
||||
bugreporter::trackNullOrUndefValue(errorNode, ArgE, *R);
|
||||
// Emit the bug report.
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
// Always return. Either we cached out or we just emitted an error.
|
||||
|
|
|
@ -117,7 +117,7 @@ void NilArgChecker::WarnNilArg(CheckerContext &C,
|
|||
|
||||
BugReport *R = new BugReport(*BT, os.str(), N);
|
||||
R->addRange(msg.getArgSourceRange(Arg));
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ void CFNumberCreateChecker::checkPreStmt(const CallExpr *CE,
|
|||
|
||||
BugReport *report = new BugReport(*BT, os.str(), N);
|
||||
report->addRange(CE->getArg(2)->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -433,7 +433,7 @@ void CFRetainReleaseChecker::checkPreStmt(const CallExpr *CE,
|
|||
BugReport *report = new BugReport(*BT, description, N);
|
||||
report->addRange(Arg->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, Arg, *report);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ void ClassReleaseChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
|
|||
|
||||
BugReport *report = new BugReport(*BT, os.str(), N);
|
||||
report->addRange(msg.getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
|
|||
|
||||
BugReport *R = new BugReport(*BT, os.str(), errorNode.getValue());
|
||||
R->addRange(msg.getArgSourceRange(I));
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ void BoolAssignmentChecker::emitReport(ProgramStateRef state,
|
|||
if (ExplodedNode *N = C.addTransition(state)) {
|
||||
if (!BT)
|
||||
BT.reset(new BuiltinBug("Assignment of a non-Boolean value"));
|
||||
C.EmitReport(new BugReport(*BT, BT->getDescription(), N));
|
||||
C.emitReport(new BugReport(*BT, BT->getDescription(), N));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C,
|
|||
|
||||
report->addRange(S->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, S, *report);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C,
|
|||
// reference is outside the range.
|
||||
|
||||
report->addRange(S->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -544,7 +544,7 @@ void CStringChecker::emitOverlapBug(CheckerContext &C, ProgramStateRef state,
|
|||
report->addRange(First->getSourceRange());
|
||||
report->addRange(Second->getSourceRange());
|
||||
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
ProgramStateRef CStringChecker::checkAdditionOverflow(CheckerContext &C,
|
||||
|
@ -607,7 +607,7 @@ ProgramStateRef CStringChecker::checkAdditionOverflow(CheckerContext &C,
|
|||
|
||||
// Generate a report for this bug.
|
||||
BugReport *report = new BugReport(*BT_AdditionOverflow, warning, N);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state,
|
|||
os.str(), N);
|
||||
|
||||
report->addRange(Ex->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
return UndefinedVal();
|
||||
|
||||
|
@ -778,7 +778,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state,
|
|||
os.str(), N);
|
||||
|
||||
report->addRange(Ex->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
return UndefinedVal();
|
||||
|
|
|
@ -77,7 +77,7 @@ void CallAndMessageChecker::emitBadCall(BugType *BT, CheckerContext &C,
|
|||
R->addRange(BadE->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, BadE, *R);
|
||||
}
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
static StringRef describeUninitializedArgumentInCall(const CallEvent &Call,
|
||||
|
@ -123,7 +123,7 @@ bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
|
|||
R->addRange(argRange);
|
||||
if (argEx)
|
||||
bugreporter::trackNullOrUndefValue(N, argEx, *R);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
|
|||
|
||||
// FIXME: enhance track back for uninitialized value for arbitrary
|
||||
// memregions
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ void CallAndMessageChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
|
|||
// FIXME: getTrackNullOrUndefValueVisitor can't handle "super" yet.
|
||||
if (const Expr *ReceiverE = ME->getInstanceReceiver())
|
||||
bugreporter::trackNullOrUndefValue(N, ReceiverE, *R);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
|
@ -379,7 +379,7 @@ void CallAndMessageChecker::emitNilReceiverBug(CheckerContext &C,
|
|||
if (const Expr *receiver = ME->getInstanceReceiver()) {
|
||||
bugreporter::trackNullOrUndefValue(N, receiver, *report);
|
||||
}
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
static bool supportsNilWithFloatRet(const llvm::Triple &triple) {
|
||||
|
|
|
@ -75,7 +75,7 @@ void CastSizeChecker::checkPreStmt(const CastExpr *CE,CheckerContext &C) const {
|
|||
BugReport *R = new BugReport(*BT, BT->getDescription(),
|
||||
errorNode);
|
||||
R->addRange(CE->getSourceRange());
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ void CastToStructChecker::checkPreStmt(const CastExpr *CE,
|
|||
"errors or data corruption."));
|
||||
BugReport *R = new BugReport(*BT,BT->getDescription(), N);
|
||||
R->addRange(CE->getSourceRange());
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ void ChrootChecker::checkPreStmt(const CallExpr *CE, CheckerContext &C) const {
|
|||
"after chroot"));
|
||||
BugReport *R = new BugReport(*BT_BreakJail,
|
||||
BT_BreakJail->getDescription(), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -162,7 +162,7 @@ void DereferenceChecker::reportBug(ProgramStateRef State, const Stmt *S,
|
|||
I = Ranges.begin(), E = Ranges.end(); I!=E; ++I)
|
||||
report->addRange(*I);
|
||||
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S,
|
||||
|
@ -177,7 +177,7 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S,
|
|||
new BugReport(*BT_undef, BT_undef->getDescription(), N);
|
||||
bugreporter::trackNullOrUndefValue(N, bugreporter::GetDerefExpr(N),
|
||||
*report);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ void DivZeroChecker::reportBug(const char *Msg,
|
|||
|
||||
BugReport *R = new BugReport(*BT, Msg, N);
|
||||
bugreporter::trackNullOrUndefValue(N, bugreporter::GetDenomExpr(N), *R);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ void ExprInspectionChecker::analyzerEval(const CallExpr *CE,
|
|||
BT.reset(new BugType("Checking analyzer assumptions", "debug"));
|
||||
|
||||
BugReport *R = new BugReport(*BT, getArgumentValueString(CE, C), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
void ExprInspectionChecker::analyzerCheckInlined(const CallExpr *CE,
|
||||
|
@ -113,7 +113,7 @@ void ExprInspectionChecker::analyzerCheckInlined(const CallExpr *CE,
|
|||
BT.reset(new BugType("Checking analyzer assumptions", "debug"));
|
||||
|
||||
BugReport *R = new BugReport(*BT, getArgumentValueString(CE, C), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
void ento::registerExprInspectionChecker(CheckerManager &Mgr) {
|
||||
|
|
|
@ -58,7 +58,7 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator *B,
|
|||
"environments or platforms."));
|
||||
BugReport *R = new BugReport(*BT, BT->getDescription(), N);
|
||||
R->addRange(B->getRHS()->getSourceRange());
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -653,7 +653,7 @@ bool GenericTaintChecker::generateReportIfTainted(const Expr *E,
|
|||
initBugType();
|
||||
BugReport *report = new BugReport(*BT, Msg, N);
|
||||
report->addRange(E->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -430,7 +430,7 @@ void IdempotentOperationChecker::checkEndAnalysis(ExplodedGraph &G,
|
|||
FindLastStoreBRVisitor::registerStatementVarDecls(*report, RHS);
|
||||
}
|
||||
|
||||
BR.EmitReport(report);
|
||||
BR.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ void MacOSKeychainAPIChecker::
|
|||
Report->addVisitor(new SecKeychainBugVisitor(AP.first));
|
||||
Report->addRange(ArgExpr->getSourceRange());
|
||||
markInteresting(Report, AP);
|
||||
C.EmitReport(Report);
|
||||
C.emitReport(Report);
|
||||
}
|
||||
|
||||
void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
|
||||
|
@ -323,7 +323,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
|
|||
Report->addVisitor(new SecKeychainBugVisitor(V));
|
||||
Report->addRange(ArgExpr->getSourceRange());
|
||||
Report->markInteresting(AS->Region);
|
||||
C.EmitReport(Report);
|
||||
C.emitReport(Report);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -376,7 +376,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
|
|||
Report->addRange(ArgExpr->getSourceRange());
|
||||
if (AS)
|
||||
Report->markInteresting(AS->Region);
|
||||
C.EmitReport(Report);
|
||||
C.emitReport(Report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
|
|||
Report->addVisitor(new SecKeychainBugVisitor(ArgSM));
|
||||
Report->addRange(ArgExpr->getSourceRange());
|
||||
Report->markInteresting(AS->Region);
|
||||
C.EmitReport(Report);
|
||||
C.emitReport(Report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -604,7 +604,7 @@ void MacOSKeychainAPIChecker::checkDeadSymbols(SymbolReaper &SR,
|
|||
// Generate the error reports.
|
||||
for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end();
|
||||
I != E; ++I) {
|
||||
C.EmitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
|
||||
C.emitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
|
||||
}
|
||||
|
||||
// Generate the new, cleaned up state.
|
||||
|
@ -654,7 +654,7 @@ void MacOSKeychainAPIChecker::checkEndPath(CheckerContext &C) const {
|
|||
// Generate the error reports.
|
||||
for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end();
|
||||
I != E; ++I) {
|
||||
C.EmitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
|
||||
C.emitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
|
||||
}
|
||||
|
||||
C.addTransition(state, N);
|
||||
|
|
|
@ -94,7 +94,7 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE,
|
|||
|
||||
BugReport *report = new BugReport(*BT_dispatchOnce, os.str(), N);
|
||||
report->addRange(CE->getArg(0)->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -714,7 +714,7 @@ ProgramStateRef MallocChecker::FreeMemAux(CheckerContext &C,
|
|||
R->addRange(ArgExpr->getSourceRange());
|
||||
R->markInteresting(Sym);
|
||||
R->addVisitor(new MallocBugVisitor(Sym));
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -849,7 +849,7 @@ void MallocChecker::ReportBadFree(CheckerContext &C, SVal ArgVal,
|
|||
BugReport *R = new BugReport(*BT_BadFree, os.str(), N);
|
||||
R->markInteresting(MR);
|
||||
R->addRange(range);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1048,7 +1048,7 @@ void MallocChecker::reportLeak(SymbolRef Sym, ExplodedNode *N,
|
|||
BugReport *R = new BugReport(*BT_Leak, os.str(), N, LocUsedForUniqueing);
|
||||
R->markInteresting(Sym);
|
||||
R->addVisitor(new MallocBugVisitor(Sym, true));
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper,
|
||||
|
@ -1224,7 +1224,7 @@ bool MallocChecker::checkUseAfterFree(SymbolRef Sym, CheckerContext &C,
|
|||
R->addRange(S->getSourceRange());
|
||||
R->markInteresting(Sym);
|
||||
R->addVisitor(new MallocBugVisitor(Sym));
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ void NSAutoreleasePoolChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
|
|||
BugReport *Report = new BugReport(*BT, "Use -drain instead of -release when "
|
||||
"using NSAutoreleasePool and garbage collection", N);
|
||||
Report->addRange(msg.getSourceRange());
|
||||
C.EmitReport(Report);
|
||||
C.emitReport(Report);
|
||||
}
|
||||
|
||||
void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) {
|
||||
|
|
|
@ -285,7 +285,7 @@ void NSOrCFErrorDerefChecker::checkEvent(ImplicitNullDerefEvent event) const {
|
|||
bug = new CFErrorDerefBug();
|
||||
BugReport *report = new BugReport(*bug, os.str(),
|
||||
event.SinkNode);
|
||||
BR.EmitReport(report);
|
||||
BR.emitReport(report);
|
||||
}
|
||||
|
||||
static bool IsNSError(QualType T, IdentifierInfo *II) {
|
||||
|
|
|
@ -50,7 +50,7 @@ void ObjCAtSyncChecker::checkPreStmt(const ObjCAtSynchronizedStmt *S,
|
|||
BugReport *report =
|
||||
new BugReport(*BT_undef, BT_undef->getDescription(), N);
|
||||
bugreporter::trackNullOrUndefValue(N, Ex, *report);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ void ObjCAtSyncChecker::checkPreStmt(const ObjCAtSynchronizedStmt *S,
|
|||
new BugReport(*BT_null, BT_null->getDescription(), N);
|
||||
bugreporter::trackNullOrUndefValue(N, Ex, *report);
|
||||
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ void ObjCContainersChecker::checkPreStmt(const CallExpr *CE,
|
|||
initBugType();
|
||||
BugReport *R = new BugReport(*BT, "Index is out of bounds", N);
|
||||
R->addRange(IdxExpr->getSourceRange());
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ static void checkForInvalidSelf(const Expr *E, CheckerContext &C,
|
|||
|
||||
BugReport *report =
|
||||
new BugReport(*new InitSelfBug(), errorStr, N);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
void ObjCSelfInitChecker::checkPostObjCMessage(const ObjCMethodCall &Msg,
|
||||
|
|
|
@ -59,7 +59,7 @@ void PointerArithChecker::checkPreStmt(const BinaryOperator *B,
|
|||
"dangerous."));
|
||||
BugReport *R = new BugReport(*BT, BT->getDescription(), N);
|
||||
R->addRange(B->getSourceRange());
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator *B,
|
|||
"the same memory chunk may cause incorrect result."));
|
||||
BugReport *R = new BugReport(*BT, BT->getDescription(), N);
|
||||
R->addRange(B->getSourceRange());
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void PthreadLockChecker::AcquireLock(CheckerContext &C, const CallExpr *CE,
|
|||
"This lock has already "
|
||||
"been acquired", N);
|
||||
report->addRange(CE->getArg(0)->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ void PthreadLockChecker::ReleaseLock(CheckerContext &C, const CallExpr *CE,
|
|||
"Possible lock order "
|
||||
"reversal", N);
|
||||
report->addRange(CE->getArg(0)->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3121,7 +3121,7 @@ void RetainCountChecker::processNonLeakError(ProgramStateRef St,
|
|||
C.isObjCGCEnabled(), SummaryLog,
|
||||
N, Sym);
|
||||
report->addRange(ErrorRange);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -3351,7 +3351,7 @@ void RetainCountChecker::checkReturnWithRetEffect(const ReturnStmt *S,
|
|||
new CFRefLeakReport(*getLeakAtReturnBug(LOpts, GCEnabled),
|
||||
LOpts, GCEnabled, SummaryLog,
|
||||
N, Sym, C);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3372,7 +3372,7 @@ void RetainCountChecker::checkReturnWithRetEffect(const ReturnStmt *S,
|
|||
new CFRefReport(*returnNotOwnedForOwned,
|
||||
C.getASTContext().getLangOpts(),
|
||||
C.isObjCGCEnabled(), SummaryLog, N, Sym);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3552,7 +3552,7 @@ RetainCountChecker::handleAutoreleaseCounts(ProgramStateRef state,
|
|||
CFRefReport *report =
|
||||
new CFRefReport(*overAutorelease, LOpts, /* GCEnabled = */ false,
|
||||
SummaryLog, N, Sym, os.str());
|
||||
Ctx.EmitReport(report);
|
||||
Ctx.emitReport(report);
|
||||
}
|
||||
|
||||
return std::make_pair((ExplodedNode *)0, (ProgramStateRef )0);
|
||||
|
@ -3598,7 +3598,7 @@ RetainCountChecker::processLeaks(ProgramStateRef state,
|
|||
|
||||
CFRefLeakReport *report = new CFRefLeakReport(*BT, LOpts, GCEnabled,
|
||||
SummaryLog, N, *I, Ctx);
|
||||
Ctx.EmitReport(report);
|
||||
Ctx.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ void ReturnPointerRangeChecker::checkPreStmt(const ReturnStmt *RS,
|
|||
new BugReport(*BT, BT->getDescription(), N);
|
||||
|
||||
report->addRange(RetE->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ void ReturnUndefChecker::checkPreStmt(const ReturnStmt *RS,
|
|||
report->addRange(RetE->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, RetE, *report);
|
||||
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
void ento::registerReturnUndefChecker(CheckerManager &mgr) {
|
||||
|
|
|
@ -179,7 +179,7 @@ void SimpleStreamChecker::reportDoubleClose(SymbolRef FileDescSym,
|
|||
"Closing a previously closed file stream", ErrNode);
|
||||
R->addRange(CallExpr->getSourceRange());
|
||||
R->markInteresting(FileDescSym);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
void SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams,
|
||||
|
@ -192,7 +192,7 @@ void SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams,
|
|||
BugReport *R = new BugReport(*LeakBugType,
|
||||
"Opened file is never closed; potential resource leak", ErrNode);
|
||||
R->markInteresting(*I);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ void StackAddrEscapeChecker::EmitStackError(CheckerContext &C, const MemRegion *
|
|||
if (range.isValid())
|
||||
report->addRange(range);
|
||||
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
void StackAddrEscapeChecker::checkPreStmt(const ReturnStmt *RS,
|
||||
|
@ -232,7 +232,7 @@ void StackAddrEscapeChecker::checkEndPath(CheckerContext &Ctx) const {
|
|||
if (range.isValid())
|
||||
report->addRange(range);
|
||||
|
||||
Ctx.EmitReport(report);
|
||||
Ctx.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -287,7 +287,7 @@ void StreamChecker::Fseek(CheckerContext &C, const CallExpr *CE) const {
|
|||
"SEEK_SET, SEEK_END, or SEEK_CUR."));
|
||||
BugReport *R = new BugReport(*BT_illegalwhence,
|
||||
BT_illegalwhence->getDescription(), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ ProgramStateRef StreamChecker::CheckNullStream(SVal SV, ProgramStateRef state,
|
|||
BT_nullfp.reset(new BuiltinBug("NULL stream pointer",
|
||||
"Stream pointer might be NULL."));
|
||||
BugReport *R =new BugReport(*BT_nullfp, BT_nullfp->getDescription(), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ ProgramStateRef StreamChecker::CheckDoubleClose(const CallExpr *CE,
|
|||
" closed. Cause undefined behaviour."));
|
||||
BugReport *R = new BugReport(*BT_doubleclose,
|
||||
BT_doubleclose->getDescription(), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ void StreamChecker::checkDeadSymbols(SymbolReaper &SymReaper,
|
|||
"Opened File never closed. Potential Resource leak."));
|
||||
BugReport *R = new BugReport(*BT_ResourceLeak,
|
||||
BT_ResourceLeak->getDescription(), N);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ void StreamChecker::checkEndPath(CheckerContext &Ctx) const {
|
|||
"Opened File never closed. Potential Resource leak."));
|
||||
BugReport *R = new BugReport(*BT_ResourceLeak,
|
||||
BT_ResourceLeak->getDescription(), N);
|
||||
Ctx.EmitReport(R);
|
||||
Ctx.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ void TaintTesterChecker::checkPostStmt(const Expr *E,
|
|||
initBugType();
|
||||
BugReport *report = new BugReport(*BT, "tainted",N);
|
||||
report->addRange(E->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ void UndefBranchChecker::checkBranchCondition(const Stmt *Condition,
|
|||
bugreporter::trackNullOrUndefValue(N, Ex, *R);
|
||||
R->addRange(Ex->getSourceRange());
|
||||
|
||||
Ctx.EmitReport(R);
|
||||
Ctx.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ UndefCapturedBlockVarChecker::checkPostStmt(const BlockExpr *BE,
|
|||
R->addVisitor(new FindLastStoreBRVisitor(VRVal, VR));
|
||||
R->disablePathPruning();
|
||||
// need location of block
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ void UndefResultChecker::checkPostStmt(const BinaryOperator *B,
|
|||
else
|
||||
bugreporter::trackNullOrUndefValue(N, B, *report);
|
||||
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ UndefinedArraySubscriptChecker::checkPreStmt(const ArraySubscriptExpr *A,
|
|||
BugReport *R = new BugReport(*BT, BT->getName(), N);
|
||||
R->addRange(A->getIdx()->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, A->getIdx(), *R);
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
|
|||
R->addRange(ex->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, ex, *R);
|
||||
}
|
||||
C.EmitReport(R);
|
||||
C.emitReport(R);
|
||||
}
|
||||
|
||||
void ento::registerUndefinedAssignmentChecker(CheckerManager &mgr) {
|
||||
|
|
|
@ -139,7 +139,7 @@ void UnixAPIChecker::CheckOpen(CheckerContext &C, const CallExpr *CE) const {
|
|||
"Call to 'open' requires a third argument when "
|
||||
"the 'O_CREAT' flag is set", N);
|
||||
report->addRange(oflagsEx->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ void UnixAPIChecker::CheckPthreadOnce(CheckerContext &C,
|
|||
|
||||
BugReport *report = new BugReport(*BT_pthreadOnce, os.str(), N);
|
||||
report->addRange(CE->getArg(0)->getSourceRange());
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -227,7 +227,7 @@ bool UnixAPIChecker::ReportZeroByteAllocation(CheckerContext &C,
|
|||
|
||||
report->addRange(arg->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, arg, *report);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ void VLASizeChecker::reportBug(VLASize_Kind Kind,
|
|||
BugReport *report = new BugReport(*BT, os.str(), N);
|
||||
report->addRange(SizeE->getSourceRange());
|
||||
bugreporter::trackNullOrUndefValue(N, SizeE, *report);
|
||||
C.EmitReport(report);
|
||||
C.emitReport(report);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2106,7 +2106,7 @@ void BugReporter::Register(BugType *BT) {
|
|||
BugTypes = F.add(BugTypes, BT);
|
||||
}
|
||||
|
||||
void BugReporter::EmitReport(BugReport* R) {
|
||||
void BugReporter::emitReport(BugReport* R) {
|
||||
// Compute the bug report's hash to determine its equivalence class.
|
||||
llvm::FoldingSetNodeID ID;
|
||||
R->Profile(ID);
|
||||
|
@ -2309,7 +2309,7 @@ void BugReporter::EmitBasicReport(const Decl *DeclWithIssue,
|
|||
BugReport *R = new BugReport(*BT, str, Loc);
|
||||
R->setDeclWithIssue(DeclWithIssue);
|
||||
for ( ; NumRanges > 0 ; --NumRanges, ++RBeg) R->addRange(*RBeg);
|
||||
EmitReport(R);
|
||||
emitReport(R);
|
||||
}
|
||||
|
||||
BugType *BugReporter::getBugTypeForName(StringRef name,
|
||||
|
|
Загрузка…
Ссылка в новой задаче