aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Checker/CStringChecker.cpp5
-rw-r--r--lib/Checker/PthreadLockChecker.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/Checker/CStringChecker.cpp b/lib/Checker/CStringChecker.cpp
index d61fdd437d..966d04f6e1 100644
--- a/lib/Checker/CStringChecker.cpp
+++ b/lib/Checker/CStringChecker.cpp
@@ -905,7 +905,10 @@ bool CStringChecker::EvalCallExpr(CheckerContext &C, const CallExpr *CE) {
return false;
// Get the name of the callee. If it's a builtin, strip off the prefix.
- llvm::StringRef Name = FD->getName();
+ IdentifierInfo *II = FD->getIdentifier();
+ if (!II) // if no identifier, not a simple C function
+ return false;
+ llvm::StringRef Name = II->getName();
if (Name.startswith("__builtin_"))
Name = Name.substr(10);
diff --git a/lib/Checker/PthreadLockChecker.cpp b/lib/Checker/PthreadLockChecker.cpp
index 74e266c3ed..c4bd364138 100644
--- a/lib/Checker/PthreadLockChecker.cpp
+++ b/lib/Checker/PthreadLockChecker.cpp
@@ -65,7 +65,10 @@ void PthreadLockChecker::PostVisitCallExpr(CheckerContext &C,
if (!R)
return;
- llvm::StringRef FName = R->getDecl()->getName();
+ IdentifierInfo *II = R->getDecl()->getIdentifier();
+ if (!II) // if no identifier, not a simple C function
+ return;
+ llvm::StringRef FName = II->getName();
if (FName == "pthread_mutex_lock") {
if (CE->getNumArgs() != 1)