afl_cc llvm 18 build fixes (#1759)
This commit is contained in:
parent
a07563def0
commit
440e57dd6f
@ -344,27 +344,29 @@ bool AutoTokensPass::runOnModule(Module &M) {
|
||||
isStrcmp &=
|
||||
FT->getNumParams() == 2 && FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0) == FT->getParamType(1) &&
|
||||
FT->getParamType(0) == IntegerType::getInt8PtrTy(M.getContext());
|
||||
FT->getParamType(0) ==
|
||||
IntegerType::getInt8Ty(M.getContext())->getPointerTo(0);
|
||||
isStrcasecmp &=
|
||||
FT->getNumParams() == 2 && FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0) == FT->getParamType(1) &&
|
||||
FT->getParamType(0) == IntegerType::getInt8PtrTy(M.getContext());
|
||||
FT->getParamType(0) ==
|
||||
IntegerType::getInt8Ty(M.getContext())->getPointerTo(0);
|
||||
isMemcmp &= FT->getNumParams() == 3 &&
|
||||
FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0)->isPointerTy() &&
|
||||
FT->getParamType(1)->isPointerTy() &&
|
||||
FT->getParamType(2)->isIntegerTy();
|
||||
isStrncmp &= FT->getNumParams() == 3 &&
|
||||
FT->getReturnType()->isIntegerTy(32) &&
|
||||
isStrncmp &=
|
||||
FT->getNumParams() == 3 && FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0) == FT->getParamType(1) &&
|
||||
FT->getParamType(0) ==
|
||||
IntegerType::getInt8PtrTy(M.getContext()) &&
|
||||
IntegerType::getInt8Ty(M.getContext())->getPointerTo(0) &&
|
||||
FT->getParamType(2)->isIntegerTy();
|
||||
isStrncasecmp &= FT->getNumParams() == 3 &&
|
||||
FT->getReturnType()->isIntegerTy(32) &&
|
||||
isStrncasecmp &=
|
||||
FT->getNumParams() == 3 && FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0) == FT->getParamType(1) &&
|
||||
FT->getParamType(0) ==
|
||||
IntegerType::getInt8PtrTy(M.getContext()) &&
|
||||
IntegerType::getInt8Ty(M.getContext())->getPointerTo(0) &&
|
||||
FT->getParamType(2)->isIntegerTy();
|
||||
isStdString &= FT->getNumParams() >= 2 &&
|
||||
FT->getParamType(0)->isPointerTy() &&
|
||||
|
@ -334,7 +334,8 @@ bool CmpLogRoutines::hookRtns(Module &M) {
|
||||
isStrcmp &=
|
||||
FT->getNumParams() == 2 && FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0) == FT->getParamType(1) &&
|
||||
FT->getParamType(0) == IntegerType::getInt8PtrTy(M.getContext());
|
||||
FT->getParamType(0) ==
|
||||
IntegerType::getInt8Ty(M.getContext())->getPointerTo(0);
|
||||
|
||||
bool isStrncmp = (!FuncName.compare("strncmp") ||
|
||||
!FuncName.compare("xmlStrncmp") ||
|
||||
@ -347,11 +348,11 @@ bool CmpLogRoutines::hookRtns(Module &M) {
|
||||
!FuncName.compare("g_ascii_strncasecmp") ||
|
||||
!FuncName.compare("Curl_strncasecompare") ||
|
||||
!FuncName.compare("g_strncasecmp"));
|
||||
isStrncmp &= FT->getNumParams() == 3 &&
|
||||
FT->getReturnType()->isIntegerTy(32) &&
|
||||
isStrncmp &=
|
||||
FT->getNumParams() == 3 && FT->getReturnType()->isIntegerTy(32) &&
|
||||
FT->getParamType(0) == FT->getParamType(1) &&
|
||||
FT->getParamType(0) ==
|
||||
IntegerType::getInt8PtrTy(M.getContext()) &&
|
||||
IntegerType::getInt8Ty(M.getContext())->getPointerTo(0) &&
|
||||
FT->getParamType(2)->isIntegerTy();
|
||||
|
||||
bool isGccStdStringStdString =
|
||||
|
@ -99,7 +99,11 @@ static inline bool isIgnoreFunction(const llvm::Function *F) {
|
||||
};
|
||||
|
||||
for (auto const &ignoreListFunc : ignoreList) {
|
||||
#if LLVM_VERSION_MAJOR >= 18
|
||||
if (F->getName().starts_with(ignoreListFunc)) { return true; }
|
||||
#else
|
||||
if (F->getName().startswith(ignoreListFunc)) { return true; }
|
||||
#endif
|
||||
}
|
||||
static constexpr const char *ignoreSubstringList[] = {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user