Skip to content

Commit e443d68

Browse files
authored
Fix python bindings (#3164)
* fix python bindings when compiling for ARM Qemu user * apply partial precommit.sh
1 parent 8b194bd commit e443d68

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

libafl_qemu/src/arch/arm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use capstone::arch::BuildsCapstone;
44
use enum_map::{EnumMap, enum_map};
55
use num_enum::{IntoPrimitive, TryFromPrimitive};
66
#[cfg(feature = "python")]
7+
#[allow(unused)]
78
use pyo3::prelude::*;
89
pub use strum_macros::EnumIter;
910
pub use syscall_numbers::arm::*;

libafl_qemu/src/qemu/usermode.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,14 @@ pub mod pybind {
494494
extern "C" fn py_syscall_hook_wrapper(
495495
_data: u64,
496496
sys_num: i32,
497-
a0: u64,
498-
a1: u64,
499-
a2: u64,
500-
a3: u64,
501-
a4: u64,
502-
a5: u64,
503-
a6: u64,
504-
a7: u64,
497+
a0: GuestAddr,
498+
a1: GuestAddr,
499+
a2: GuestAddr,
500+
a3: GuestAddr,
501+
a4: GuestAddr,
502+
a5: GuestAddr,
503+
a6: GuestAddr,
504+
a7: GuestAddr,
505505
) -> hooks::SyscallHookResult {
506506
unsafe { (&raw const PY_SYSCALL_HOOK).read() }.map_or_else(
507507
|| hooks::SyscallHookResult::Run,

libafl_targets/src/libfuzzer/mutators.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use alloc::{
55
vec::Vec,
66
};
77
use core::{cell::RefCell, marker::PhantomData, ops::Deref};
8-
use libafl::corpus::CorpusId;
8+
99
use libafl::{
1010
Error,
11-
corpus::Corpus,
11+
corpus::{Corpus, CorpusId},
1212
inputs::{BytesInput, HasMutatorBytes, ResizableMutator},
1313
mutators::{
1414
ComposedByMutations, MutationId, MutationResult, Mutator, MutatorsTuple, ScheduledMutator,
@@ -304,7 +304,10 @@ where
304304
}
305305
#[inline]
306306
fn post_exec(&mut self, state: &mut S, new_corpus_id: Option<CorpusId>) -> Result<(), Error> {
307-
self.mutator.deref().borrow_mut().post_exec(state, new_corpus_id)
307+
self.mutator
308+
.deref()
309+
.borrow_mut()
310+
.post_exec(state, new_corpus_id)
308311
}
309312
}
310313

@@ -387,7 +390,10 @@ where
387390
}
388391
#[inline]
389392
fn post_exec(&mut self, state: &mut S, new_corpus_id: Option<CorpusId>) -> Result<(), Error> {
390-
self.mutator.deref().borrow_mut().post_exec(state, new_corpus_id)
393+
self.mutator
394+
.deref()
395+
.borrow_mut()
396+
.post_exec(state, new_corpus_id)
391397
}
392398
}
393399

0 commit comments

Comments
 (0)