current inmemory executor static var (not working)
This commit is contained in:
parent
ce9413bfa4
commit
e7578305d6
@ -34,14 +34,19 @@ pub struct InMemoryExecutor {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static mut CURRENT_INMEMORY_EXECUTOR: Option<&InMemoryExecutor> = None;
|
||||||
|
|
||||||
impl Executor for InMemoryExecutor {
|
impl Executor for InMemoryExecutor {
|
||||||
|
|
||||||
fn run_target(&mut self) -> Result<ExitKind, AflError> {
|
fn run_target(&mut self) -> Result<ExitKind, AflError> {
|
||||||
let bytes = self.base.cur_input.serialize();
|
let bytes = self.base.cur_input.serialize();
|
||||||
return match bytes {
|
unsafe { CURRENT_INMEMORY_EXECUTOR = Some(self); }
|
||||||
|
let outcome = match bytes {
|
||||||
Ok(b) => Ok((self.harness)(self, b)),
|
Ok(b) => Ok((self.harness)(self, b)),
|
||||||
Err(e) => Err(e)
|
Err(e) => Err(e)
|
||||||
}
|
};
|
||||||
|
unsafe { CURRENT_INMEMORY_EXECUTOR = None; }
|
||||||
|
outcome
|
||||||
}
|
}
|
||||||
|
|
||||||
fn place_input(&mut self, input: Box<dyn Input>) -> Result<(), AflError> {
|
fn place_input(&mut self, input: Box<dyn Input>) -> Result<(), AflError> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user