about summary refs log tree commit diff
path: root/instrumentation
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-05-16 12:34:38 +0200
committerGitHub <noreply@github.com>2022-05-16 12:34:38 +0200
commita2eb1f14126cffd046c44d5e87e945ed2699cec5 (patch)
tree2eecf55a92eec04e67aa3a9d9bec8e5f50659de6 /instrumentation
parentc7bb0a9638a8929a5b664f16032c23a55a84be70 (diff)
parentc08eeb95ca78625cf3f8a96bd04320c57c50d0f1 (diff)
downloadafl++-a2eb1f14126cffd046c44d5e87e945ed2699cec5.tar.gz
Merge pull request #1404 from AFLplusplus/dev
push to stable
Diffstat (limited to 'instrumentation')
-rw-r--r--instrumentation/SanitizerCoveragePCGUARD.so.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/instrumentation/SanitizerCoveragePCGUARD.so.cc b/instrumentation/SanitizerCoveragePCGUARD.so.cc
index f80b1a1e..408353b3 100644
--- a/instrumentation/SanitizerCoveragePCGUARD.so.cc
+++ b/instrumentation/SanitizerCoveragePCGUARD.so.cc
@@ -313,13 +313,25 @@ PreservedAnalyses ModuleSanitizerCoverageAFL::run(Module &               M,
 std::pair<Value *, Value *> ModuleSanitizerCoverageAFL::CreateSecStartEnd(
     Module &M, const char *Section, Type *Ty) {
 
-  GlobalVariable *SecStart = new GlobalVariable(
-      M, Ty->getPointerElementType(), false,
-      GlobalVariable::ExternalWeakLinkage, nullptr, getSectionStart(Section));
+  GlobalVariable *SecStart =
+      new GlobalVariable(M,
+#if LLVM_VERSION_MAJOR >= 15
+                         Ty,
+#else
+                         Ty->getPointerElementType(),
+#endif
+                         false, GlobalVariable::ExternalWeakLinkage, nullptr,
+                         getSectionStart(Section));
   SecStart->setVisibility(GlobalValue::HiddenVisibility);
-  GlobalVariable *SecEnd = new GlobalVariable(
-      M, Ty->getPointerElementType(), false,
-      GlobalVariable::ExternalWeakLinkage, nullptr, getSectionEnd(Section));
+  GlobalVariable *SecEnd =
+      new GlobalVariable(M,
+#if LLVM_VERSION_MAJOR >= 15
+                         Ty,
+#else
+                         Ty->getPointerElementType(),
+#endif
+                         false, GlobalVariable::ExternalWeakLinkage, nullptr,
+                         getSectionEnd(Section));
   SecEnd->setVisibility(GlobalValue::HiddenVisibility);
   IRBuilder<> IRB(M.getContext());
   if (!TargetTriple.isOSBinFormatCOFF())