about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-09-22 09:32:16 +0200
committervan Hauser <vh@thc.org>2020-09-22 09:32:16 +0200
commitdaa2285083a1046ff69e398366a858a2558134fb (patch)
tree89a9e91fc12a3089a70f419e669b75fd80680515
parent639372b6441cf961ff91f6427201e1156b8511e3 (diff)
downloadafl++-daa2285083a1046ff69e398366a858a2558134fb.tar.gz
fix LTO autodictionary for ints > 64 bits
-rw-r--r--instrumentation/SanitizerCoverageLTO.so.cc2
-rw-r--r--instrumentation/afl-llvm-lto-instrumentation.so.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/instrumentation/SanitizerCoverageLTO.so.cc b/instrumentation/SanitizerCoverageLTO.so.cc
index 64162145..82e55218 100644
--- a/instrumentation/SanitizerCoverageLTO.so.cc
+++ b/instrumentation/SanitizerCoverageLTO.so.cc
@@ -526,7 +526,7 @@ bool ModuleSanitizerCoverage::instrumentModule(
             Value *      op = cmpInst->getOperand(1);
             ConstantInt *ilen = dyn_cast<ConstantInt>(op);
 
-            if (ilen) {
+            if (ilen && ilen->uge(0xffffffffffffffff) == false) {
 
               u64 val2 = 0, val = ilen->getZExtValue();
               u32 len = 0;
diff --git a/instrumentation/afl-llvm-lto-instrumentation.so.cc b/instrumentation/afl-llvm-lto-instrumentation.so.cc
index 2f936c29..9e026e57 100644
--- a/instrumentation/afl-llvm-lto-instrumentation.so.cc
+++ b/instrumentation/afl-llvm-lto-instrumentation.so.cc
@@ -293,7 +293,7 @@ bool AFLLTOPass::runOnModule(Module &M) {
             Value *      op = cmpInst->getOperand(1);
             ConstantInt *ilen = dyn_cast<ConstantInt>(op);
 
-            if (ilen) {
+            if (ilen && ilen->uge(0xffffffffffffffff) == false) {
 
               u64 val2 = 0, val = ilen->getZExtValue();
               u32 len = 0;