diff options
author | hexcoder- <heiko@hexco.de> | 2021-01-04 22:23:04 +0100 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2021-01-04 22:23:04 +0100 |
commit | 7f4b3a460a0b4f83e9039b57c033f6f43be08550 (patch) | |
tree | 103d54bd62478660e3639525f72ffd4b2d1a2d13 /instrumentation/compare-transform-pass.so.cc | |
parent | 251e72f13654b5259f57075c7dffcc3a43372449 (diff) | |
download | afl++-7f4b3a460a0b4f83e9039b57c033f6f43be08550.tar.gz |
more code cleanup (instrumentation)
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 de8b97f0..887970a0 100644 --- a/instrumentation/compare-transform-pass.so.cc +++ b/instrumentation/compare-transform-pass.so.cc @@ -101,6 +101,12 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, IntegerType * Int64Ty = IntegerType::getInt64Ty(C); #if LLVM_VERSION_MAJOR < 9 + Function *tolowerFn; +#else + FunctionCallee tolowerFn; +#endif + { +#if LLVM_VERSION_MAJOR < 9 Constant * #else FunctionCallee @@ -112,11 +118,11 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, #endif ); #if LLVM_VERSION_MAJOR < 9 - Function *tolowerFn = cast<Function>(c); + tolowerFn = cast<Function>(c); #else - FunctionCallee tolowerFn = c; + tolowerFn = c; #endif - + } /* iterate over all functions, bbs and instruction and add suitable calls to * strcmp/memcmp/strncmp/strcasecmp/strncasecmp */ for (auto &F : M) { @@ -234,7 +240,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, if (!HasStr2) { - auto *Ptr = dyn_cast<ConstantExpr>(Str1P); + Ptr = dyn_cast<ConstantExpr>(Str1P); if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) { if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) { |