Skip to content

Commit

Permalink
more clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rmalmain committed Jan 24, 2025
1 parent 543cbe6 commit 8b28b19
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
12 changes: 12 additions & 0 deletions libafl_cc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const LLVM_VERSION_MAX: u32 = 33;
const LLVM_VERSION_MIN: u32 = 6;

/// Get the extension for a shared object
#[cfg(any(unix, windows))]
fn dll_extension<'a>() -> &'a str {
if let Ok(vendor) = env::var("CARGO_CFG_TARGET_VENDOR") {
if vendor == "apple" {
Expand Down Expand Up @@ -143,6 +144,17 @@ fn find_llvm_version() -> Option<i32> {
None
}

#[cfg(any(
feature = "ddg-instr",
feature = "function-logging",
feature = "cmplog-routines",
feature = "autotokens",
feature = "coverage-accounting",
feature = "cmplog-instructions",
feature = "ctx",
feature = "dump-cfg",
feature = "profiling",
))]
#[expect(clippy::too_many_arguments)]
fn build_pass(
bindir_path: &Path,
Expand Down
2 changes: 2 additions & 0 deletions libafl_concolic/symcc_runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ pub mod cpp_runtime {
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused_attributes)]

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
}

Expand Down
4 changes: 2 additions & 2 deletions libafl_intelpt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use arbitrary_int::u4;
use bitbybit::bitfield;
#[cfg(target_os = "linux")]
use caps::{CapSet, Capability};
use libafl_bolts::Error;
#[cfg(target_os = "linux")]
use libafl_bolts::ownedref::OwnedRefMut;
use libafl_bolts::{hash_64_fast, Error};
use libafl_bolts::{hash_64_fast, ownedref::OwnedRefMut};
use libipt::PtError;
#[cfg(target_os = "linux")]
use libipt::{
Expand Down
18 changes: 16 additions & 2 deletions libafl_qemu/src/modules/drcov.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[cfg(feature = "usermode")]
use std::{
cmp::{max, min},
ops::Range,
path::PathBuf,
sync::Mutex,
};
use std::{path::PathBuf, sync::Mutex};

use hashbrown::{hash_map::Entry, HashMap};
use libafl::{executors::ExitKind, observers::ObserversTuple, HasMetadata};
Expand Down Expand Up @@ -304,6 +304,20 @@ where
self.module_mapping.is_some(),
"DrCov should have a module mapping already set."
);

if self.full_trace {
emulator_modules.blocks(
Hook::Function(gen_unique_block_ids::<ET, F, I, S>),
Hook::Function(gen_block_lengths::<ET, F, I, S>),
Hook::Function(exec_trace_block::<ET, F, I, S>),
);
} else {
emulator_modules.blocks(
Hook::Function(gen_unique_block_ids::<ET, F, I, S>),
Hook::Function(gen_block_lengths::<ET, F, I, S>),
Hook::Empty,
);
};
}

fn post_exec<OT, ET>(
Expand Down
5 changes: 2 additions & 3 deletions libafl_qemu/src/modules/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use core::{fmt::Debug, ops::Range};
use core::fmt::Debug;

use libafl::{executors::ExitKind, observers::ObserversTuple};
use libafl_bolts::tuples::{MatchFirstType, SplitBorrowExtractFirstType};
#[cfg(feature = "systemmode")]
use libafl_qemu_sys::GuestPhysAddr;

use crate::{
emu::EmulatorModules,
Expand All @@ -19,6 +17,7 @@ pub use usermode::*;
#[cfg(feature = "systemmode")]
pub mod systemmode;
#[cfg(feature = "systemmode")]
#[expect(unused_imports)]
pub use systemmode::*;

pub mod edges;
Expand Down

0 comments on commit 8b28b19

Please sign in to comment.