about summary refs log tree commit diff
path: root/instrumentation
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2022-01-19 22:17:36 +0100
committervanhauser-thc <vh@thc.org>2022-01-19 22:17:36 +0100
commit4bcb177f62695da4f76f3e74393c8018d52f8a7c (patch)
treee8bbc172527de4958f4ec5bb483e55af3f04b7cd /instrumentation
parent409a6517c1e60e91b6d6154496b5f77fdce2186a (diff)
downloadafl++-4bcb177f62695da4f76f3e74393c8018d52f8a7c.tar.gz
Revert "fix classify counts"
This reverts commit 4217a6606c92f6a88ab577ae8f91823dd731562d.
Diffstat (limited to 'instrumentation')
-rw-r--r--instrumentation/afl-llvm-common.h16
-rw-r--r--instrumentation/afl-llvm-pass.so.cc13
-rw-r--r--instrumentation/cmplog-instructions-pass.cc33
3 files changed, 28 insertions, 34 deletions
diff --git a/instrumentation/afl-llvm-common.h b/instrumentation/afl-llvm-common.h
index dee5f9fc..bd424e21 100644
--- a/instrumentation/afl-llvm-common.h
+++ b/instrumentation/afl-llvm-common.h
@@ -33,17 +33,17 @@ typedef long double max_align_t;
 #endif
 
 #if LLVM_VERSION_MAJOR >= 11
-  #define MNAME M.getSourceFileName()
-  #define FMNAME F.getParent()->getSourceFileName()
+ #define MNAME M.getSourceFileName()
+ #define FMNAME F.getParent()->getSourceFileName()
 #else
-  #define MNAME std::string("")
-  #define FMNAME std::string("")
+ #define MNAME std::string("")
+ #define FMNAME std::string("")
 #endif
 
-char *getBBName(const llvm::BasicBlock *BB);
-bool  isIgnoreFunction(const llvm::Function *F);
-void  initInstrumentList();
-bool  isInInstrumentList(llvm::Function *F, std::string Filename);
+char *                 getBBName(const llvm::BasicBlock *BB);
+bool                   isIgnoreFunction(const llvm::Function *F);
+void                   initInstrumentList();
+bool                   isInInstrumentList(llvm::Function *F, std::string Filename);
 unsigned long long int calculateCollisions(uint32_t edges);
 void                   scanForDangerousFunctions(llvm::Module *M);
 
diff --git a/instrumentation/afl-llvm-pass.so.cc b/instrumentation/afl-llvm-pass.so.cc
index 5246ba08..899734f8 100644
--- a/instrumentation/afl-llvm-pass.so.cc
+++ b/instrumentation/afl-llvm-pass.so.cc
@@ -631,23 +631,18 @@ bool AFLCoverage::runOnModule(Module &M) {
       LoadInst *PrevLoc;
 
       if (ngram_size) {
-
         PrevLoc = IRB.CreateLoad(
 #if LLVM_VERSION_MAJOR >= 14
-            PrevLocTy,
+          PrevLocTy,
 #endif
-            AFLPrevLoc);
-
+          AFLPrevLoc);
       } else {
-
         PrevLoc = IRB.CreateLoad(
 #if LLVM_VERSION_MAJOR >= 14
-            IRB.getInt32Ty(),
+          IRB.getInt32Ty(),
 #endif
-            AFLPrevLoc);
-
+          AFLPrevLoc);
       }
-
       PrevLoc->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
       Value *PrevLocTrans;
 
diff --git a/instrumentation/cmplog-instructions-pass.cc b/instrumentation/cmplog-instructions-pass.cc
index 310f5585..a0b386d5 100644
--- a/instrumentation/cmplog-instructions-pass.cc
+++ b/instrumentation/cmplog-instructions-pass.cc
@@ -478,28 +478,27 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
           */
           if (is_fp) {
 
-            /*
-                        ConstantFP *i0 = dyn_cast<ConstantFP>(op0);
-                        ConstantFP *i1 = dyn_cast<ConstantFP>(op1);
-                        // BUG FIXME TODO: this is null ... but why?
-                        // fprintf(stderr, "%p %p\n", i0, i1);
-                        if (i0) {
-
-                          cur_val = (uint64_t)i0->getValue().convertToDouble();
-                          if (last_val0 && last_val0 == cur_val) { skip = 1; }
-                          last_val0 = cur_val;
+/*
+            ConstantFP *i0 = dyn_cast<ConstantFP>(op0);
+            ConstantFP *i1 = dyn_cast<ConstantFP>(op1);
+            // BUG FIXME TODO: this is null ... but why?
+            // fprintf(stderr, "%p %p\n", i0, i1);
+            if (i0) {
 
-                        }
+              cur_val = (uint64_t)i0->getValue().convertToDouble();
+              if (last_val0 && last_val0 == cur_val) { skip = 1; }
+              last_val0 = cur_val;
 
-                        if (i1) {
+            }
 
-                          cur_val = (uint64_t)i1->getValue().convertToDouble();
-                          if (last_val1 && last_val1 == cur_val) { skip = 1; }
-                          last_val1 = cur_val;
+            if (i1) {
 
-                        }
+              cur_val = (uint64_t)i1->getValue().convertToDouble();
+              if (last_val1 && last_val1 == cur_val) { skip = 1; }
+              last_val1 = cur_val;
 
-            */
+            }
+*/
 
           } else {