Skip to content

Commit 76f10a7

Browse files
authored
Merge pull request #89 from fitzgen/update-libfuzzer-60e32a1
Update libFuzzer to llvm/llvm-project@60e32a1
2 parents fcf3b18 + 1aa53e0 commit 76f10a7

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

ci/script.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ pushd ./example
1111
cargo rustc \
1212
--release \
1313
-- \
14-
-Cpasses='sancov' \
14+
-Ccodegen-units=1 \
15+
-Cpasses=sancov-module \
1516
-Cllvm-args=-sanitizer-coverage-level=3 \
1617
-Cllvm-args=-sanitizer-coverage-trace-compares \
1718
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \
@@ -26,7 +27,8 @@ pushd ./example_arbitrary
2627
cargo rustc \
2728
--release \
2829
-- \
29-
-Cpasses='sancov' \
30+
-Ccodegen-units=1 \
31+
-Cpasses=sancov-module \
3032
-Cllvm-args=-sanitizer-coverage-level=3 \
3133
-Cllvm-args=-sanitizer-coverage-trace-compares \
3234
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \
@@ -46,7 +48,8 @@ pushd ./example_mutator
4648
cargo rustc \
4749
--release \
4850
-- \
49-
-Cpasses='sancov' \
51+
-Ccodegen-units=1 \
52+
-Cpasses=sancov-module \
5053
-Cllvm-args=-sanitizer-coverage-level=3 \
5154
-Cllvm-args=-sanitizer-coverage-trace-compares \
5255
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \

example/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use libfuzzer_sys::fuzz_target;
44

55
fuzz_target!(|data: &[u8]| {
6-
if data == b"banana!" {
6+
if data == "banana!".as_bytes() {
77
panic!("success!");
88
}
99
});

libfuzzer/FuzzerInterceptors.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
}
2626

2727
#include <cassert>
28+
#include <cstddef> // for size_t
2829
#include <cstdint>
2930
#include <dlfcn.h> // for dlsym()
3031

libfuzzer/dataflow/DataFlow.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
// and also provides basic-block coverage for every input.
1818
//
1919
// Build:
20-
// 1. Compile this file (DataFlow.cpp) with -fsanitize=dataflow -mllvm
21-
// -dfsan-fast-16-labels and -O2.
20+
// 1. Compile this file (DataFlow.cpp) with -fsanitize=dataflow and -O2.
2221
// 2. Compile DataFlowCallbacks.cpp with -O2 -fPIC.
2322
// 3. Build the fuzz target with -g -fsanitize=dataflow
24-
// -mllvm -dfsan-fast-16-labels
2523
// -fsanitize-coverage=trace-pc-guard,pc-table,bb,trace-cmp
2624
// 4. Link those together with -fsanitize=dataflow
2725
//
@@ -82,7 +80,7 @@ static inline bool BlockIsEntry(size_t BlockIdx) {
8280
return __dft.PCsBeg[BlockIdx * 2 + 1] & PCFLAG_FUNC_ENTRY;
8381
}
8482

85-
const int kNumLabels = 16;
83+
const int kNumLabels = 8;
8684

8785
// Prints all instrumented functions.
8886
static int PrintFunctions() {

0 commit comments

Comments
 (0)