about summary refs log tree commit diff
path: root/instrumentation/compare-transform-pass.so.cc
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2024-06-01 16:37:28 +0200
committerGitHub <noreply@github.com>2024-06-01 16:37:28 +0200
commit348f980f2180a5bab745066f8c7dcd0049998626 (patch)
tree34bb1853847ce6ee80ffe57c3ce581195be3238f /instrumentation/compare-transform-pass.so.cc
parente7d871c8bf64962a658e447b90a1a3b43aaddc28 (diff)
parentca55858aa7ecb1a4cd420e3c325fe604a5b5c30d (diff)
downloadafl++-348f980f2180a5bab745066f8c7dcd0049998626.tar.gz
Merge pull request #2108 from AFLplusplus/dev
push to stable
Diffstat (limited to 'instrumentation/compare-transform-pass.so.cc')
-rw-r--r--instrumentation/compare-transform-pass.so.cc14
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;