[cfe-commits] [Patch][Review Request]Revised patch for PR7287
Jim Goodnow II
jim at thegoodnows.net
Mon Nov 1 15:01:06 PDT 2010
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR7287.b.patch
Type: application/octet-stream
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101101/f0ac2d90/attachment.obj>
More information about the cfe-commits
mailing list