Doug,

This isn't the right fix.  VisitCallExpr() should never be called with 
functions that don't have an identifier.

On Nov 1, 2010, at 4:18 PM, Douglas Gregor wrote:

> 
> On Nov 1, 2010, at 3:01 PM, Jim Goodnow II wrote:
> 
>> Okay, how about this? :-)
> 
> Thanks, committed as r117970. 
> 
>       - Doug
> 
>> 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)<PR7287.b.patch>_______________________________________________
>> cfe-commits mailing list
>> [email protected]
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


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

Reply via email to