diff options
author | vanhauser-thc <vh@thc.org> | 2024-05-19 13:47:53 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2024-05-19 13:47:53 +0200 |
commit | 31a8beb44967207a8eecc17440783304493f145a (patch) | |
tree | d9b3ae326001b31ba7f207d17da479cc2a04141e /instrumentation/compare-transform-pass.so.cc | |
parent | 56d5aa3101945e81519a3fac8783d0d8fad82779 (diff) | |
download | afl++-31a8beb44967207a8eecc17440783304493f145a.tar.gz |
support new llvm 19 changes
Diffstat (limited to 'instrumentation/compare-transform-pass.so.cc')
-rw-r--r-- | instrumentation/compare-transform-pass.so.cc | 14 |
1 files changed, 10 insertions, 4 deletions
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 <set> #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; |