aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/NoReturnFunctionChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-16 05:58:28 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-16 05:58:28 +0000
commitb01a322ed6bc20e08b6a25b070070aac2eb5dd9e (patch)
treed602a9bb22435398c4ec3bc92fc7a82d1c502543 /lib/Analysis/NoReturnFunctionChecker.cpp
parent6b8ee78873442c2d52ecc8ac344dffa2c2cffbe2 (diff)
Teach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not guaranteed to return a non-null IdentifierInfo*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/NoReturnFunctionChecker.cpp')
-rw-r--r--lib/Analysis/NoReturnFunctionChecker.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Analysis/NoReturnFunctionChecker.cpp b/lib/Analysis/NoReturnFunctionChecker.cpp
index 6806273d4b..5cfd9acd5f 100644
--- a/lib/Analysis/NoReturnFunctionChecker.cpp
+++ b/lib/Analysis/NoReturnFunctionChecker.cpp
@@ -45,13 +45,12 @@ bool NoReturnFunctionChecker::EvalCallExpr(CheckerContext &C,
if (FD->getAttr<NoReturnAttr>() || FD->getAttr<AnalyzerNoReturnAttr>())
BuildSinks = true;
- else {
+ else if (const IdentifierInfo *II = FD->getIdentifier()) {
// HACK: Some functions are not marked noreturn, and don't return.
// Here are a few hardwired ones. If this takes too long, we can
// potentially cache these results.
- using llvm::StringRef;
BuildSinks
- = llvm::StringSwitch<bool>(StringRef(FD->getIdentifier()->getName()))
+ = llvm::StringSwitch<bool>(llvm::StringRef(II->getName()))
.Case("exit", true)
.Case("panic", true)
.Case("error", true)