Skip to content

Commit ef22e56

Browse files
author
Michael Rodler
committed
fixed and defaulted back to sancov 8bit instrumentation
instead of cloning the `COUNTER_MAPS` Vec, it is now drained into a new Vec pass to the Observer
1 parent 53efc58 commit ef22e56

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

cargo-libafl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ rustc_version = "0.4"
3030
xdg = "2.4"
3131

3232
[features]
33+
default = ["sancov_8bit"]
3334
sancov_8bit = []
3435
tui = []

cargo-libafl/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ fn main() {
5151
cmd.current_dir(&out_path)
5252
.env("CARGO_TARGET_DIR", out_path.join("rt"))
5353
.arg("build");
54+
cmd.arg("--no-default-features");
5455
#[cfg(feature = "sancov_8bit")]
5556
cmd.arg("--features").arg("sancov_8bit");
5657
#[cfg(feature = "tui")]

cargo-libafl/cargo-libafl-runtime/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ crate-type = ["staticlib", "rlib"]
3333
path = "runtime.rs"
3434

3535
[features]
36+
default = [ "sancov_8bit" ]
3637
sancov_8bit = []
3738
tui = []

cargo-libafl/cargo-libafl-runtime/runtime.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use libafl::{
1616
rands::StdRand,
1717
shmem::{ShMemProvider, StdShMemProvider},
1818
tuples::{tuple_list, Merge},
19-
AsSlice,
19+
AsMutSlice, AsSlice,
2020
},
2121
corpus::{self, CachedOnDiskCorpus, Corpus, OnDiskCorpus},
2222
events::EventConfig,
@@ -36,6 +36,7 @@ use libafl::{
3636
StdMOptMutator,
3737
},
3838
observers::{BacktraceObserver, TimeObserver},
39+
prelude::OwnedMutSlice,
3940
schedulers::{
4041
powersched::PowerSchedule, IndexesLenTimeMinimizerScheduler, PowerQueueScheduler,
4142
},
@@ -218,9 +219,8 @@ pub fn main() {
218219

219220
#[cfg(feature = "sancov_8bit")]
220221
let edges_observer = {
221-
let edges = unsafe { &mut COUNTERS_MAPS };
222-
// TODO: is the call to edges.clone here the reason for breaking sancov_8bit?
223-
HitcountsIterableMapObserver::new(MultiMapObserver::new("edges", edges.clone()))
222+
let edges = unsafe { COUNTERS_MAPS.drain(0..).collect() };
223+
HitcountsIterableMapObserver::new(MultiMapObserver::new("edges", edges))
224224
};
225225

226226
#[cfg(not(feature = "sancov_8bit"))]

0 commit comments

Comments
 (0)