[Analyzer] Check function name size before indexing.
https://reviews.llvm.org/D37908 llvm-svn: 313385
This commit is contained in:
parent
457fb0b4a0
commit
e28adb4fb2
|
|
@ -1211,7 +1211,8 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) {
|
|||
|
||||
// Check for release functions, the only kind of functions that we care
|
||||
// about that don't return a pointer type.
|
||||
if (FName[0] == 'C' && (FName[1] == 'F' || FName[1] == 'G')) {
|
||||
if (FName.size() >= 2 &&
|
||||
FName[0] == 'C' && (FName[1] == 'F' || FName[1] == 'G')) {
|
||||
// Test for 'CGCF'.
|
||||
FName = FName.substr(FName.startswith("CGCF") ? 4 : 2);
|
||||
|
||||
|
|
|
|||
|
|
@ -461,3 +461,5 @@ void radar13722286::PrepareBitmap() {
|
|||
}
|
||||
}
|
||||
|
||||
// rdar://34210609
|
||||
void _() { _(); }; // no-warning
|
||||
|
|
|
|||
Loading…
Reference in New Issue