mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-11 08:48:12 +00:00
Analyzer: Fix PR12905, a crash when encountering a call to a function named "C".
While there clean up indentation. llvm-svn: 157204
This commit is contained in:
parent
fc732755ad
commit
9bbf481f02
@ -161,16 +161,15 @@ bool CallOrObjCMessage::hasNonZeroCallbackArg() const {
|
||||
}
|
||||
|
||||
bool CallOrObjCMessage::isCFCGAllowingEscape(StringRef FName) {
|
||||
if (FName[0] == 'C' && (FName[1] == 'F' || FName[1] == 'G'))
|
||||
if (StrInStrNoCase(FName, "InsertValue") != StringRef::npos||
|
||||
if (!FName.startswith("CF") && !FName.startswith("CG"))
|
||||
return false;
|
||||
|
||||
return StrInStrNoCase(FName, "InsertValue") != StringRef::npos ||
|
||||
StrInStrNoCase(FName, "AddValue") != StringRef::npos ||
|
||||
StrInStrNoCase(FName, "SetValue") != StringRef::npos ||
|
||||
StrInStrNoCase(FName, "WithData") != StringRef::npos ||
|
||||
StrInStrNoCase(FName, "AppendValue") != StringRef::npos ||
|
||||
StrInStrNoCase(FName, "SetAttribute") != StringRef::npos) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
StrInStrNoCase(FName, "SetAttribute") != StringRef::npos;
|
||||
}
|
||||
|
||||
|
||||
|
8
clang/test/Analysis/PR12905.c
Normal file
8
clang/test/Analysis/PR12905.c
Normal file
@ -0,0 +1,8 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core %s
|
||||
// PR12905
|
||||
|
||||
void C(void);
|
||||
|
||||
void t(void) {
|
||||
C();
|
||||
}
|
Loading…
Reference in New Issue
Block a user