diff options
author | van Hauser <vh@thc.org> | 2020-08-31 19:04:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-31 19:04:37 +0200 |
commit | 2dffed1cffcd78db16412d0531d2976bfd3bc0fe (patch) | |
tree | dd41be1ffcc9e471591d7c7bd899baf1987aeb97 /llvm_mode/afl-llvm-lto-instrumentation.so.cc | |
parent | 42ef1968a530d5fe598d53e93431dfcff3727b4b (diff) | |
parent | e93f78eca53e3b1542d109fd9b4c634831e9fd63 (diff) | |
download | afl++-2dffed1cffcd78db16412d0531d2976bfd3bc0fe.tar.gz |
Merge pull request #534 from AFLplusplus/dev
push to stable for GSOC
Diffstat (limited to 'llvm_mode/afl-llvm-lto-instrumentation.so.cc')
-rw-r--r-- | llvm_mode/afl-llvm-lto-instrumentation.so.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/llvm_mode/afl-llvm-lto-instrumentation.so.cc b/llvm_mode/afl-llvm-lto-instrumentation.so.cc index 12509ab2..125db229 100644 --- a/llvm_mode/afl-llvm-lto-instrumentation.so.cc +++ b/llvm_mode/afl-llvm-lto-instrumentation.so.cc @@ -87,7 +87,7 @@ class AFLLTOPass : public ModulePass { bool runOnModule(Module &M) override; protected: - int afl_global_id = 1, autodictionary = 0; + int afl_global_id = 1, autodictionary = 1; uint32_t function_minimum_size = 1; uint32_t inst_blocks = 0, inst_funcs = 0, total_instr = 0; uint64_t map_addr = 0x10000; @@ -128,8 +128,6 @@ bool AFLLTOPass::runOnModule(Module &M) { be_quiet = 1; - if (getenv("AFL_LLVM_CMPLOG")) autodictionary = 0; - if ((ptr = getenv("AFL_LLVM_DOCUMENT_IDS")) != NULL) { if ((documentFile = fopen(ptr, "a")) == NULL) @@ -137,8 +135,6 @@ bool AFLLTOPass::runOnModule(Module &M) { } - if (getenv("AFL_LLVM_LTO_AUTODICTIONARY")) autodictionary = 1; - // we make this the default as the fixed map has problems with // defered forkserver, early constructors, ifuncs and maybe more /*if (getenv("AFL_LLVM_MAP_DYNAMIC"))*/ @@ -378,16 +374,29 @@ bool AFLLTOPass::runOnModule(Module &M) { std::string Str1, Str2; StringRef TmpStr; bool HasStr1 = getConstantStringInfo(Str1P, TmpStr); - if (TmpStr.empty()) + if (TmpStr.empty()) { + HasStr1 = false; - else + + } else { + + HasStr1 = true; Str1 = TmpStr.str(); + + } + bool HasStr2 = getConstantStringInfo(Str2P, TmpStr); - if (TmpStr.empty()) + if (TmpStr.empty()) { + HasStr2 = false; - else + + } else { + + HasStr2 = true; Str2 = TmpStr.str(); + } + if (debug) fprintf(stderr, "F:%s %p(%s)->\"%s\"(%s) %p(%s)->\"%s\"(%s)\n", FuncName.c_str(), Str1P, Str1P->getName().str().c_str(), |