Skip to content

Commit

Permalink
fix mismatched types
Browse files Browse the repository at this point in the history
  • Loading branch information
BAGUVIX456 committed Dec 15, 2024
1 parent e17d84e commit 4de182a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions libafl/src/events/llmp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use serde::Deserialize;
#[cfg(feature = "share_objectives")]
use crate::{
corpus::{Corpus, Testcase},
state::{HasCorpus, HasSolutions},
state::{HasCurrentTestcase, HasSolutions},
};
use crate::{
events::{CustomBufEventResult, CustomBufHandlerFn, Event, EventFirer},
Expand Down Expand Up @@ -395,7 +395,14 @@ where
#[cfg(feature = "share_objectives")]
impl<DI, IC, ICB, S, SP> LlmpEventConverter<DI, IC, ICB, S, SP>
where
S: UsesInput + HasExecutions + HasMetadata + Stoppable + HasCorpus + HasSolutions,
S: UsesInput
+ HasExecutions
+ HasSolutions
+ HasMetadata
+ Stoppable
+ State
+ HasCurrentTestcase,
S::Solutions: Corpus<Input = S::Input>,
SP: ShMemProvider,
IC: InputConverter<From = S::Input, To = DI>,
ICB: InputConverter<From = DI, To = S::Input>,
Expand Down Expand Up @@ -447,8 +454,14 @@ where
return Ok(());
};

let testcase = Testcase::from(converter.convert(input)?);
let converted_input = converter.convert(input)?;
let mut testcase = Testcase::from(converted_input);
testcase.set_parent_id_optional(*state.corpus().current());

if let Ok(mut tc) = state.current_testcase_mut() {
tc.found_objective();
}

state.solutions_mut().add(testcase)?;
log::info!("Added received Objective to Corpus");

Expand Down
1 change: 1 addition & 0 deletions libafl/src/stages/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ where
DI: Input,
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone,
S::Corpus: Corpus<Input = S::Input>, // delete me
S::Solutions: Corpus<Input = S::Input>,
{
#[inline]
fn perform(
Expand Down

0 comments on commit 4de182a

Please sign in to comment.