From e6f27c2645bd3e4d4a8163b7432818e26dedfeef Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Thu, 7 Jul 2022 00:34:30 +0200 Subject: add missing laf compare split predicates --- instrumentation/split-compares-pass.so.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'instrumentation/split-compares-pass.so.cc') diff --git a/instrumentation/split-compares-pass.so.cc b/instrumentation/split-compares-pass.so.cc index d7bb7aba..e069cabe 100644 --- a/instrumentation/split-compares-pass.so.cc +++ b/instrumentation/split-compares-pass.so.cc @@ -566,8 +566,16 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, case CmpInst::ICMP_NE: case CmpInst::ICMP_UGT: case CmpInst::ICMP_ULT: + case CmpInst::ICMP_UGE: + case CmpInst::ICMP_ULE: + case CmpInst::ICMP_SGT: + case CmpInst::ICMP_SLT: + case CmpInst::ICMP_SGE: + case CmpInst::ICMP_SLE: break; default: + fprintf(stderr, "Error: split-compare: Unsupported predicate (%u)\n", + pred); // unsupported predicate! return false; @@ -581,6 +589,7 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, if (!intTyOp0) { // not an integer type + fprintf(stderr, "Error: split-compare: not an integer type\n"); return false; } @@ -675,6 +684,12 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, } + case CmpInst::ICMP_SGE: + case CmpInst::ICMP_SLE: + case CmpInst::ICMP_SGT: + case CmpInst::ICMP_SLT: + case CmpInst::ICMP_UGE: + case CmpInst::ICMP_ULE: case CmpInst::ICMP_UGT: case CmpInst::ICMP_ULT: { @@ -729,6 +744,7 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, } default: + fprintf(stderr, "Error: split-compare: should not happen\n"); return false; } -- cgit 1.4.1 From 05080f32eeaf2cf357cd7ba4eff5743baf28237b Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Thu, 7 Jul 2022 11:10:12 +0200 Subject: fixes --- Dockerfile | 5 ++++- instrumentation/split-compares-pass.so.cc | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'instrumentation/split-compares-pass.so.cc') diff --git a/Dockerfile b/Dockerfile index 610c664d..6246148f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ # # This Dockerfile for AFLplusplus uses Ubuntu 22.04 jammy and -# installs LLVM 14 for afl-clang-lto support :-) +# installs LLVM 14 for afl-clang-lto support. +# +# GCC 11 is used instead of 12 because genhtml for afl-cov doesn't like it. # FROM ubuntu:22.04 AS aflplusplus @@ -25,6 +27,7 @@ RUN apt-get update && \ libglib2.0-dev \ wget vim jupp nano bash-completion less \ apt-utils apt-transport-https ca-certificates gnupg dialog \ + joe vim ssh \ libpixman-1-dev \ gnuplot-nox \ && rm -rf /var/lib/apt/lists/* diff --git a/instrumentation/split-compares-pass.so.cc b/instrumentation/split-compares-pass.so.cc index e069cabe..375de065 100644 --- a/instrumentation/split-compares-pass.so.cc +++ b/instrumentation/split-compares-pass.so.cc @@ -574,8 +574,9 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, case CmpInst::ICMP_SLE: break; default: - fprintf(stderr, "Error: split-compare: Unsupported predicate (%u)\n", - pred); + if (!be_quiet) + fprintf(stderr, "Error: split-compare: Unsupported predicate (%u)\n", + pred); // unsupported predicate! return false; @@ -702,7 +703,8 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, CmpInst * icmp_inv_cmp = nullptr; BasicBlock * inv_cmp_bb = BasicBlock::Create(C, "inv_cmp", end_bb->getParent(), end_bb); - if (pred == CmpInst::ICMP_UGT) { + if (pred == CmpInst::ICMP_UGT || pred == CmpInst::ICMP_SGT || + pred == CmpInst::ICMP_UGE || pred == CmpInst::ICMP_SGE) { icmp_inv_cmp = CmpInst::Create(Instruction::ICmp, CmpInst::ICMP_ULT, op0_high, op1_high); @@ -744,7 +746,8 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M, } default: - fprintf(stderr, "Error: split-compare: should not happen\n"); + if (!be_quiet) + fprintf(stderr, "Error: split-compare: should not happen\n"); return false; } -- cgit 1.4.1