diff options
| author | vanhauser-thc <vh@thc.org> | 2024-04-07 09:44:33 +0200 |
|---|---|---|
| committer | vanhauser-thc <vh@thc.org> | 2024-04-07 09:44:33 +0200 |
| commit | 45603367bfb71948f56715ac88e34c05c0dc0486 (patch) | |
| tree | 9e2535f8cec6750d9ecfe5d398384fd21c916b97 /instrumentation/injection-pass.cc | |
| parent | f7ea0f569fa57e22548c1dc8eaba2903213e496e (diff) | |
| download | afl++-45603367bfb71948f56715ac88e34c05c0dc0486.tar.gz | |
fix llvm modules
Diffstat (limited to 'instrumentation/injection-pass.cc')
| -rw-r--r-- | instrumentation/injection-pass.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/instrumentation/injection-pass.cc b/instrumentation/injection-pass.cc index 2280208b..47ddabd9 100644 --- a/instrumentation/injection-pass.cc +++ b/instrumentation/injection-pass.cc @@ -204,6 +204,8 @@ bool InjectionRoutines::hookRtns(Module &M) { Function *FuncPtr; #endif + bool ret = false; + /* iterate over all functions, bbs and instruction and add suitable calls */ for (auto &F : M) { @@ -281,6 +283,7 @@ bool InjectionRoutines::hookRtns(Module &M) { IRBuilder<> IRB(callInst->getParent()); IRB.SetInsertPoint(callInst); + ret = true; Value *parameter = callInst->getArgOperand(param); @@ -299,7 +302,7 @@ bool InjectionRoutines::hookRtns(Module &M) { } - return true; + return ret; } @@ -328,16 +331,16 @@ bool InjectionRoutines::runOnModule(Module &M) { if (getenv("AFL_LLVM_INJECTIONS_LDAP")) { doLDAP = true; } if (getenv("AFL_LLVM_INJECTIONS_XSS")) { doXSS = true; } - hookRtns(M); -#if LLVM_VERSION_MAJOR >= 11 /* use new pass manager */ - auto PA = PreservedAnalyses::all(); -#endif + bool ret = hookRtns(M); verifyModule(M); #if LLVM_VERSION_MAJOR >= 11 /* use new pass manager */ - return PA; + if (ret == false) + return PreservedAnalyses::all(); + else + return PreservedAnalyses(); #else - return true; + return ret; #endif } |
