aboutsummaryrefslogtreecommitdiff
path: root/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
commite576af2754bfa309bb10a518bbc17c81b9e0723f (patch)
tree5566c6943c4f7f4ba4e7029eac9dd5aba16b9ada /lib/Analysis/NSErrorChecker.cpp
parent33a33d8abd7a3d49eacc05e40c00b00634bf1ee9 (diff)
Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced. Addresses <rdar://problem/7039161>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/NSErrorChecker.cpp')
-rw-r--r--lib/Analysis/NSErrorChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/NSErrorChecker.cpp b/lib/Analysis/NSErrorChecker.cpp
index 93b617b115..9a8d02215e 100644
--- a/lib/Analysis/NSErrorChecker.cpp
+++ b/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());
}