From b01a322ed6bc20e08b6a25b070070aac2eb5dd9e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 16 Dec 2009 05:58:28 +0000 Subject: 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 --- lib/Analysis/NoReturnFunctionChecker.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Analysis/NoReturnFunctionChecker.cpp') 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() || FD->getAttr()) 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(StringRef(FD->getIdentifier()->getName())) + = llvm::StringSwitch(llvm::StringRef(II->getName())) .Case("exit", true) .Case("panic", true) .Case("error", true) -- cgit v1.2.3-18-g5258