[cfe-commits] r49485 - in /cfe/trunk: include/clang/Analysis/PathSensitive/BugReporter.h lib/Analysis/BasicObjCFoundationChecks.cpp lib/Analysis/GRSimpleVals.cpp

Ted Kremenek kremenek at apple.com
Thu Apr 10 09:05:13 PDT 2008


Author: kremenek
Date: Thu Apr 10 11:05:13 2008
New Revision: 49485

URL: http://llvm.org/viewvc/llvm-project?rev=49485&view=rev
Log:
Fixed regressions in error reporting due to copy-paste errors (using the "begin"
iterator instead of "end") and not implementing "getDescription()" for Nil
argument checks.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
    cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
    cfe/trunk/lib/Analysis/GRSimpleVals.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h?rev=49485&r1=49484&r2=49485&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h Thu Apr 10 11:05:13 2008
@@ -51,7 +51,10 @@
   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<ValueState> *N) const;

Modified: cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp?rev=49485&r1=49484&r2=49485&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp Thu Apr 10 11:05:13 2008
@@ -84,6 +84,13 @@
     
     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<ValueState> *N) const {
       

Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=49485&r1=49484&r2=49485&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Thu Apr 10 11:05:13 2008
@@ -135,7 +135,7 @@
   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 @@
   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 @@
     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 @@
   virtual void EmitWarnings(BugReporter& BR) {
     GRExprEngine& Eng = BR.getEngine();
     GenericEmitWarnings(BR, *this, Eng.ret_stackaddr_begin(),
-                        Eng.ret_stackaddr_begin());
+                        Eng.ret_stackaddr_end());
   }
 };
   





More information about the cfe-commits mailing list