Fix tui monitor for example fuzzers (#2699)
* Fix tui monitor for example fuzzers * New clippy lint * fix
This commit is contained in:
parent
eb2ac10d1e
commit
b3d73b2919
@ -9,7 +9,7 @@ edition = "2021"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
tui = []
|
||||
tui = ["libafl/tui_monitor"]
|
||||
std = []
|
||||
|
||||
[profile.dev]
|
||||
|
@ -10,7 +10,7 @@ edition = "2021"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
tui = []
|
||||
tui = ["libafl/tui_monitor"]
|
||||
std = []
|
||||
|
||||
[profile.dev]
|
||||
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||
default-run = "fuzzer_sd"
|
||||
|
||||
[features]
|
||||
tui = []
|
||||
tui = ["libafl/tui_monitor"]
|
||||
multimap = []
|
||||
|
||||
[profile.dev]
|
||||
|
@ -9,7 +9,7 @@ edition = "2021"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
tui = []
|
||||
tui = ["libafl/tui_monitor"]
|
||||
std = []
|
||||
|
||||
[profile.dev]
|
||||
|
@ -125,19 +125,19 @@ impl FuzzerOptions {
|
||||
pub fn is_asan_core(&self, core_id: CoreId) -> bool {
|
||||
self.asan_cores
|
||||
.as_ref()
|
||||
.map_or(false, |c| c.contains(core_id))
|
||||
.is_some_and(|c| c.contains(core_id))
|
||||
}
|
||||
|
||||
pub fn is_asan_guest_core(&self, core_id: CoreId) -> bool {
|
||||
self.asan_guest_cores
|
||||
.as_ref()
|
||||
.map_or(false, |c| c.contains(core_id))
|
||||
.is_some_and(|c| c.contains(core_id))
|
||||
}
|
||||
|
||||
pub fn is_cmplog_core(&self, core_id: CoreId) -> bool {
|
||||
self.cmplog_cores
|
||||
.as_ref()
|
||||
.map_or(false, |c| c.contains(core_id))
|
||||
.is_some_and(|c| c.contains(core_id))
|
||||
}
|
||||
|
||||
pub fn input_dir(&self) -> PathBuf {
|
||||
|
@ -291,7 +291,7 @@ where
|
||||
while bytes
|
||||
.len()
|
||||
.checked_sub(token_1.len())
|
||||
.map_or(false, |len| i < len)
|
||||
.is_some_and(|len| i < len)
|
||||
{
|
||||
if bytes[i..].starts_with(token_1) {
|
||||
bytes.splice(i..(i + token_1.len()), token_2.iter().copied());
|
||||
@ -314,7 +314,7 @@ where
|
||||
while bytes
|
||||
.len()
|
||||
.checked_sub(token_1.len())
|
||||
.map_or(false, |len| i < len)
|
||||
.is_some_and(|len| i < len)
|
||||
{
|
||||
if bytes[i..].starts_with(token_1) {
|
||||
bytes.splice(i..(i + token_1.len()), token_2.iter().copied());
|
||||
|
@ -78,7 +78,7 @@ fn choose_start<R: Rand>(
|
||||
if idx
|
||||
.checked_sub(*start) // idx adjusted to start
|
||||
.and_then(|idx| (idx < range.len()).then(|| range[idx])) // idx in range
|
||||
.map_or(false, |r| r)
|
||||
.is_some_and(|r| r)
|
||||
{
|
||||
options.push((*start, range));
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ where
|
||||
if state
|
||||
.metadata_map()
|
||||
.get::<TopAccountingMetadata>()
|
||||
.map_or(false, |x| x.changed)
|
||||
.is_some_and(|x| x.changed)
|
||||
{
|
||||
self.accounting_cull(state)?;
|
||||
} else {
|
||||
|
@ -264,7 +264,7 @@ where
|
||||
perf_score = HAVOC_MAX_MULT * 100.0;
|
||||
}
|
||||
|
||||
if entry.objectives_found() > 0 && psmeta.strat().map_or(false, |s| s.avoid_crash()) {
|
||||
if entry.objectives_found() > 0 && psmeta.strat().is_some_and(|s| s.avoid_crash()) {
|
||||
perf_score *= 0.00;
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ where
|
||||
weight *= 2.0;
|
||||
}
|
||||
|
||||
if entry.objectives_found() > 0 && psmeta.strat().map_or(false, |s| s.avoid_crash()) {
|
||||
if entry.objectives_found() > 0 && psmeta.strat().is_some_and(|s| s.avoid_crash()) {
|
||||
weight *= 0.00;
|
||||
}
|
||||
|
||||
|
@ -648,7 +648,7 @@ where
|
||||
if filename.starts_with('.')
|
||||
// || filename
|
||||
// .rsplit_once('-')
|
||||
// .map_or(false, |(_, s)| u64::from_str(s).is_ok())
|
||||
// .is_some_and(|(_, s)| u64::from_str(s).is_ok())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ impl ToolWrapper for ClangWrapper {
|
||||
|
||||
if arg_as_path
|
||||
.extension()
|
||||
.map_or(false, |ext| ext.eq_ignore_ascii_case("s"))
|
||||
.is_some_and(|ext| ext.eq_ignore_ascii_case("s"))
|
||||
{
|
||||
self.is_asm = true;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
|
||||
assert!(
|
||||
command.status().map_or(false, |s| s.success()),
|
||||
command.status().is_ok_and(|s| s.success()),
|
||||
"Couldn't build runtime crate! Did you remember to use nightly? (`rustup default nightly` to install)"
|
||||
);
|
||||
|
||||
@ -199,7 +199,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
drop(redefinitions_file);
|
||||
|
||||
assert!(
|
||||
nm_child.wait().map_or(false, |s| s.success()),
|
||||
nm_child.wait().is_ok_and(|s| s.success()),
|
||||
"Couldn't link runtime crate! Do you have the llvm-tools component installed? (`rustup component add llvm-tools-preview` to install)"
|
||||
);
|
||||
|
||||
@ -242,7 +242,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
.args([&archive_path, &redefined_archive_path]);
|
||||
|
||||
assert!(
|
||||
objcopy_command.status().map_or(false, |s| s.success()),
|
||||
objcopy_command.status().is_ok_and(|s| s.success()),
|
||||
"Couldn't rename allocators in the runtime crate! Do you have the llvm-tools component installed? (`rustup component add llvm-tools-preview` to install)"
|
||||
);
|
||||
|
||||
|
@ -341,7 +341,7 @@ where
|
||||
.count
|
||||
.checked_sub(1)
|
||||
.map(CorpusId::from)
|
||||
.map_or(false, |last| last == id)
|
||||
.is_some_and(|last| last == id)
|
||||
{
|
||||
self.last.as_ref()
|
||||
} else {
|
||||
|
@ -192,7 +192,7 @@ fn qemu_bindgen_clang_args(
|
||||
entry["output"] == main_obj
|
||||
|| entry["file"]
|
||||
.as_str()
|
||||
.map_or(false, |file| file.ends_with(main_file))
|
||||
.is_some_and(|file| file.ends_with(main_file))
|
||||
})
|
||||
.expect("Didn't find compile command for qemu-system-arm");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user