about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2019-08-07 20:26:41 +0200
committerhexcoder- <heiko@hexco.de>2019-08-07 20:26:41 +0200
commit09c95b7ea7b10796bf0002392530041ab68816f7 (patch)
tree7cb492dde4f508941a87c834f3e54f5b29f55490
parenta6fe8ae0af884c76ea92128a6fd878a13dd3abf3 (diff)
downloadafl++-09c95b7ea7b10796bf0002392530041ab68816f7.tar.gz
reviewed neverZero for llvm 9.0
-rw-r--r--llvm_mode/LLVMInsTrim.so.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm_mode/LLVMInsTrim.so.cc b/llvm_mode/LLVMInsTrim.so.cc
index fad6dd4f..0a15680d 100644
--- a/llvm_mode/LLVMInsTrim.so.cc
+++ b/llvm_mode/LLVMInsTrim.so.cc
@@ -292,10 +292,11 @@ namespace {
           Value *Incr = IRB.CreateAdd(Counter, ConstantInt::get(Int8Ty, 1));
 
 #if LLVM_VERSION_MAJOR < 9
-          if (neverZero_counters_str != NULL) { // with llvm 9 we make this the default as the bug in llvm is then fixed
+          if (neverZero_counters_str != NULL) // with llvm 9 we make this the default as the bug in llvm is then fixed
 #else
-  #warning "neverZero implementation needs to be reviewed!"
+          if (1) // with llvm 9 we make this the default as the bug in llvm is then fixed
 #endif
+          {
           /* hexcoder: Realize a counter that skips zero during overflow.
            * Once this counter reaches its maximum value, it next increments to 1
            *
@@ -308,15 +309,13 @@ namespace {
             auto cf = IRB.CreateICmpEQ(Incr, ConstantInt::get(Int8Ty, 0));
             auto carry = IRB.CreateZExt(cf, Int8Ty);
             Incr = IRB.CreateAdd(Incr, carry);
-#if LLVM_VERSION_MAJOR < 9
           }
-#endif
    
           IRB.CreateStore(Incr, MapPtrIdx)->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
    
           /* Set prev_loc to cur_loc >> 1 */
           /*
-          StoreInst *Store = IRB.CreateStore(ConstantInt::get(Int32Ty, cur_loc >> 1), AFLPrevLoc);
+          StoreInst *Store = IRB.CreateStore(ConstantInt::get(Int32Ty, L >> 1), OldPrev);
           Store->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
           */