Skip to content

Commit f96ae30

Browse files
domenukkandreafioraldi
authored andcommitted
clippy fixes, x86_64 warnings
1 parent 1d7baff commit f96ae30

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

libafl_frida/src/helper.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ use libafl_targets::drcov::{DrCovBasicBlock, DrCovWriter};
1010

1111
#[cfg(target_arch = "aarch64")]
1212
use capstone::arch::{
13+
arch::{self, BuildsCapstone},
1314
arm64::{Arm64Extender, Arm64OperandType, Arm64Shift},
1415
ArchOperand::Arm64Operand,
15-
};
16-
use capstone::{
17-
arch::{self, BuildsCapstone},
1816
Capstone, Insn,
1917
};
2018

@@ -29,6 +27,7 @@ use frida_gum::{
2927
CpuContext,
3028
};
3129
use frida_gum::{Gum, Module, PageProtection};
30+
#[cfg(target_arch = "aarch64")]
3231
use num_traits::cast::FromPrimitive;
3332

3433
use rangemap::RangeMap;
@@ -58,9 +57,11 @@ pub struct FridaInstrumentationHelper<'a> {
5857
map: [u8; MAP_SIZE],
5958
previous_pc: [u64; 1],
6059
current_log_impl: u64,
60+
#[cfg(target_arch = "aarch64")]
6161
current_report_impl: u64,
6262
/// Transformer that has to be passed to FridaInProcessExecutor
6363
transformer: Option<Transformer<'a>>,
64+
#[cfg(target_arch = "aarch64")]
6465
capstone: Capstone,
6566
asan_runtime: Rc<RefCell<AsanRuntime>>,
6667
ranges: RangeMap<usize, (u16, &'a str)>,
@@ -196,6 +197,7 @@ fn get_pc(context: &CpuContext) -> usize {
196197
/// The implementation of the FridaInstrumentationHelper
197198
impl<'a> FridaInstrumentationHelper<'a> {
198199
/// Constructor function to create a new FridaInstrumentationHelper, given a module_name.
200+
#[allow(clippy::clippy::too_many_lines)]
199201
pub fn new(
200202
gum: &'a Gum,
201203
options: &'a FridaOptions,
@@ -206,8 +208,10 @@ impl<'a> FridaInstrumentationHelper<'a> {
206208
map: [0u8; MAP_SIZE],
207209
previous_pc: [0u64; 1],
208210
current_log_impl: 0,
211+
#[cfg(target_arch = "aarch64")]
209212
current_report_impl: 0,
210213
transformer: None,
214+
#[cfg(target_arch = "aarch64")]
211215
capstone: Capstone::new()
212216
.arm64()
213217
.mode(arch::arm64::ArchMode::Arm)
@@ -216,7 +220,7 @@ impl<'a> FridaInstrumentationHelper<'a> {
216220
.expect("Failed to create Capstone object"),
217221
asan_runtime: AsanRuntime::new(options.clone()),
218222
ranges: RangeMap::new(),
219-
options: options,
223+
options,
220224
drcov_basic_blocks: vec![],
221225
};
222226

0 commit comments

Comments
 (0)