diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-01 23:16:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-01 23:16:05 +0000 |
commit | 90d26a4afdbf6d917a5241ef3b316e1c8337c9b8 (patch) | |
tree | a0566345251f156e973a878d7390064a31444439 /lib/Checker/CStringChecker.cpp | |
parent | 21e75d00b0e016fa89d54cf5b4e7d48bf5ff6e57 (diff) |
Teach the CStringChecker and PthreadLockChecker about non-identifier
declaration names, from Jim Goodnow II!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/CStringChecker.cpp')
-rw-r--r-- | lib/Checker/CStringChecker.cpp | 5 |
1 files changed, 4 insertions, 1 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); |