Skip to content

Commit

Permalink
aa
Browse files Browse the repository at this point in the history
  • Loading branch information
tokatoka committed Feb 4, 2025
1 parent d1d230e commit 1bfcd42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions libafl/src/executors/inprocess/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ where
) -> Result<ExitKind, Error> {
*state.executions_mut() += 1;

// unsafe operations for settings up pointers
// # Safety
// Don't call this from multiple thread
unsafe {
let executor_ptr = ptr::from_ref(self) as *const c_void;
self.inner
.enter_target(fuzzer, state, mgr, input, executor_ptr);
// the first hook is special
// it is for setting crash handlers
self.inner.hooks.0.enter_target_hooks();
}

self.inner.hooks.pre_exec_all(state, input);
Expand All @@ -107,7 +107,6 @@ where

self.inner.hooks.post_exec_all(state, input);

self.inner.hooks.0.leave_target_hooks();
self.inner.leave_target(fuzzer, state, mgr, input);
Ok(ret)
}
Expand Down
5 changes: 2 additions & 3 deletions libafl/src/executors/inprocess/stateful.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,21 @@ where
) -> Result<ExitKind, Error> {
*state.executions_mut() += 1;

// unsafe operations for settings up pointers
// # Safety
// Don't call this from multiple thread
unsafe {
let executor_ptr = ptr::from_ref(self) as *const c_void;
self.inner
.enter_target(fuzzer, state, mgr, input, executor_ptr);
// the first hook is special
// it is for setting crash handlers
self.inner.hooks.0.enter_target_hooks();
}
self.inner.hooks.pre_exec_all(state, input);

let ret = self.harness_fn.borrow_mut()(&mut self.exposed_executor_state, state, input);

self.inner.hooks.post_exec_all(state, input);

self.inner.hooks.0.leave_target_hooks();
self.inner.leave_target(fuzzer, state, mgr, input);
Ok(ret)
}
Expand Down

0 comments on commit 1bfcd42

Please sign in to comment.