summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/NSErrorChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-24 01:33:10 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-24 01:33:10 +0000
commitc0229557dd0a83ee19cf36999fafa1b17184daf1 (patch)
tree0de575dee5a472e5e033c66a703f0969352c4078 /clang/lib/Analysis/NSErrorChecker.cpp
parent04d2f2d192ddeaebe3bd9957b7d135bdb6d78636 (diff)
downloadbcm5719-llvm-c0229557dd0a83ee19cf36999fafa1b17184daf1.tar.gz
bcm5719-llvm-c0229557dd0a83ee19cf36999fafa1b17184daf1.zip
Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced. Addresses <rdar://problem/7039161>.
llvm-svn: 89726
Diffstat (limited to 'clang/lib/Analysis/NSErrorChecker.cpp')
-rw-r--r--clang/lib/Analysis/NSErrorChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Analysis/NSErrorChecker.cpp b/clang/lib/Analysis/NSErrorChecker.cpp
index 93b617b115d..9a8d02215eb 100644
--- a/clang/lib/Analysis/NSErrorChecker.cpp
+++ b/clang/lib/Analysis/NSErrorChecker.cpp
@@ -114,10 +114,13 @@ void NSErrorChecker::EmitRetTyWarning(BugReporter& BR, const Decl& CodeDecl) {
os << " should have a non-void return value to indicate whether or not an "
"error occurred";
+ // FIXME: Remove when we migrate EmitBasicReport to StringRef.
+ std::string cat = getCategory().str();
+
BR.EmitBasicReport(isNSErrorWarning
? "Bad return type when passing NSError**"
: "Bad return type when passing CFError*",
- getCategory().c_str(), os.str().c_str(),
+ cat.c_str(), os.str().c_str(),
CodeDecl.getLocation());
}
OpenPOWER on IntegriCloud