Skip to content
Snippets Groups Projects
Commit 9deaef7f authored by Ted Kremenek's avatar Ted Kremenek
Browse files

NSErrorChecker: remove quoting the parameter name in the diagnostic until we...

NSErrorChecker: remove quoting the parameter name in the diagnostic until we actually include it's name.

This is a possible regression of moving to using ImplicitNullDerefEvent.
Fixing this for real (including the parameter name) requires more
plumbing in ImplicitNullDerefEvent.  This is just a stop gap fix.

llvm-svn: 171502
parent 7505b5a6
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "clang/StaticAnalyzer/Core/CheckerManager.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallString.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
using namespace clang; using namespace clang;
...@@ -252,18 +252,15 @@ void NSOrCFErrorDerefChecker::checkEvent(ImplicitNullDerefEvent event) const { ...@@ -252,18 +252,15 @@ void NSOrCFErrorDerefChecker::checkEvent(ImplicitNullDerefEvent event) const {
return; return;
// Storing to possible null NSError/CFErrorRef out parameter. // Storing to possible null NSError/CFErrorRef out parameter.
llvm::SmallString<128> Buf;
llvm::raw_svector_ostream os(Buf);
// Emit an error. os << "Potential null dereference. According to coding standards ";
std::string err; os << (isNSError
llvm::raw_string_ostream os(err); ? "in 'Creating and Returning NSError Objects' the parameter"
os << "Potential null dereference. According to coding standards "; : "documented in CoreFoundation/CFError.h the parameter");
if (isNSError) os << " may be null";
os << "in 'Creating and Returning NSError Objects' the parameter '";
else
os << "documented in CoreFoundation/CFError.h the parameter '";
os << "' may be null.";
BugType *bug = 0; BugType *bug = 0;
if (isNSError) if (isNSError)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment