Okay, how about this? :-)

Index: lib/Checker/CStringChecker.cpp
===================================================================
--- lib/Checker/CStringChecker.cpp      (revision 117853)
+++ lib/Checker/CStringChecker.cpp      (working copy)
@@ -905,7 +905,10 @@
     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 idenifier, not a simple C function
+    return false;
+  llvm::StringRef Name = II->getName();
   if (Name.startswith("__builtin_"))
     Name = Name.substr(10);

Index: lib/Checker/PthreadLockChecker.cpp
===================================================================
--- lib/Checker/PthreadLockChecker.cpp  (revision 117853)
+++ lib/Checker/PthreadLockChecker.cpp  (working copy)
@@ -65,7 +65,10 @@
   if (!R)
     return;

-  llvm::StringRef FName = R->getDecl()->getName();
+  IdentifierInfo *II = R->getDecl()->getIdentifier();
+  if (!II)   // if no idenifier, not a simple C function
+    return;
+  llvm::StringRef FName = II->getName();

   if (FName == "pthread_mutex_lock") {
     if (CE->getNumArgs() != 1)

Attachment: PR7287.b.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to