From 31a8beb44967207a8eecc17440783304493f145a Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Sun, 19 May 2024 13:47:53 +0200 Subject: support new llvm 19 changes --- instrumentation/compare-transform-pass.so.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'instrumentation/compare-transform-pass.so.cc') diff --git a/instrumentation/compare-transform-pass.so.cc b/instrumentation/compare-transform-pass.so.cc index 496d69fc..36149f35 100644 --- a/instrumentation/compare-transform-pass.so.cc +++ b/instrumentation/compare-transform-pass.so.cc @@ -54,6 +54,12 @@ #define nullptr 0 #endif +#if LLVM_MAJOR >= 19 + #define STARTSWITH starts_with +#else + #define STARTSWITH startswith +#endif + #include #include "afl-llvm-common.h" @@ -532,10 +538,10 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, } if (!isSizedcmp) needs_null = true; - if (Callee->getName().startswith("g_") || - Callee->getName().startswith("curl_") || - Callee->getName().startswith("Curl_") || - Callee->getName().startswith("xml")) + if (Callee->getName().STARTSWITH("g_") || + Callee->getName().STARTSWITH("curl_") || + Callee->getName().STARTSWITH("Curl_") || + Callee->getName().STARTSWITH("xml")) nullCheck = true; Value *sizedValue = isSizedcmp ? callInst->getArgOperand(2) : NULL; -- cgit 1.4.1