diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index 9f8b17ac00..adb18ab42a 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -51,7 +51,10 @@ public: const BugType& getBugType() const { return Desc; } const char* getName() const { return getBugType().getName(); } - const char* getDescription() const { return getBugType().getDescription(); } + + virtual const char* getDescription() const { + return getBugType().getDescription(); + } virtual PathDiagnosticPiece* getEndPath(ASTContext& Ctx, ExplodedNode *N) const; diff --git a/lib/Analysis/BasicObjCFoundationChecks.cpp b/lib/Analysis/BasicObjCFoundationChecks.cpp index 154adcaa47..e5a31bf50d 100644 --- a/lib/Analysis/BasicObjCFoundationChecks.cpp +++ b/lib/Analysis/BasicObjCFoundationChecks.cpp @@ -84,6 +84,13 @@ public: virtual ~Report() {} + virtual const char* getDescription() const { return s; } + + virtual void getRanges(const SourceRange*& B, const SourceRange*& E) const { + B = &R; + E = B+1; + } + virtual PathDiagnosticPiece* getEndPath(ASTContext& Ctx, ExplodedNode *N) const { diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp index e7b456ff21..960476dff0 100644 --- a/lib/Analysis/GRSimpleVals.cpp +++ b/lib/Analysis/GRSimpleVals.cpp @@ -135,7 +135,7 @@ public: virtual void EmitWarnings(BugReporter& BR) { GRExprEngine& Eng = BR.getEngine(); GenericEmitWarnings(BR, *this, Eng.undef_results_begin(), - Eng.undef_results_begin()); + Eng.undef_results_end()); } }; @@ -152,7 +152,7 @@ public: virtual void EmitWarnings(BugReporter& BR) { GRExprEngine& Eng = BR.getEngine(); GenericEmitWarnings(BR, *this, Eng.bad_calls_begin(), - Eng.bad_calls_begin()); + Eng.bad_calls_end()); } }; @@ -214,7 +214,7 @@ public: GRExprEngine& Eng = BR.getEngine(); for (GRExprEngine::UndefArgsTy::iterator I=Eng.msg_expr_undef_arg_begin(), - E = Eng.msg_expr_undef_arg_begin(); I!=E; ++I) { + E = Eng.msg_expr_undef_arg_end(); I!=E; ++I) { // Generate a report for this bug. Report report(*this, I->second); @@ -283,7 +283,7 @@ public: virtual void EmitWarnings(BugReporter& BR) { GRExprEngine& Eng = BR.getEngine(); GenericEmitWarnings(BR, *this, Eng.ret_stackaddr_begin(), - Eng.ret_stackaddr_begin()); + Eng.ret_stackaddr_end()); } };