parent
c6420c0987
commit
44a37da680
@ -300,7 +300,10 @@ where
|
||||
/// Gets the next entry at random
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty("No entries in corpus. This often implies the target is not properly instrumented.".to_owned()))
|
||||
Err(Error::empty(
|
||||
"No entries in corpus. This often implies the target is not properly instrumented."
|
||||
.to_owned(),
|
||||
))
|
||||
} else {
|
||||
let id = random_corpus_id!(state.corpus(), state.rand_mut());
|
||||
self.set_current_scheduled(state, Some(id))?;
|
||||
|
@ -259,7 +259,9 @@ where
|
||||
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty(String::from("No entries in corpus. This often implies the target is not properly instrumented.")))
|
||||
Err(Error::empty(String::from(
|
||||
"No entries in corpus. This often implies the target is not properly instrumented.",
|
||||
)))
|
||||
} else {
|
||||
let id = match state.corpus().current() {
|
||||
Some(cur) => {
|
||||
|
@ -158,7 +158,9 @@ where
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty(String::from("No entries in corpus. This often implies the target is not properly instrumented.")))
|
||||
Err(Error::empty(String::from(
|
||||
"No entries in corpus. This often implies the target is not properly instrumented.",
|
||||
)))
|
||||
} else {
|
||||
let rand_prob: f64 = (state.rand_mut().below(100) as f64) / 100.0;
|
||||
let meta = state.metadata_map().get::<ProbabilityMetadata>().unwrap();
|
||||
|
@ -44,7 +44,10 @@ where
|
||||
/// Gets the next entry in the queue
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty("No entries in corpus. This often implies the target is not properly instrumented.".to_owned()))
|
||||
Err(Error::empty(
|
||||
"No entries in corpus. This often implies the target is not properly instrumented."
|
||||
.to_owned(),
|
||||
))
|
||||
} else {
|
||||
let id = state
|
||||
.corpus()
|
||||
|
@ -119,7 +119,10 @@ where
|
||||
/// Gets the next entry in the queue
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
return Err(Error::empty("No entries in corpus. This often implies the target is not properly instrumented.".to_owned()));
|
||||
return Err(Error::empty(
|
||||
"No entries in corpus. This often implies the target is not properly instrumented."
|
||||
.to_owned(),
|
||||
));
|
||||
}
|
||||
let id = if let Some(next) = Self::get_next(state) {
|
||||
// next was set
|
||||
|
@ -303,7 +303,9 @@ where
|
||||
fn next(&mut self, state: &mut S) -> Result<CorpusId, Error> {
|
||||
let corpus_counts = state.corpus().count();
|
||||
if corpus_counts == 0 {
|
||||
Err(Error::empty(String::from("No entries in corpus. This often implies the target is not properly instrumented.")))
|
||||
Err(Error::empty(String::from(
|
||||
"No entries in corpus. This often implies the target is not properly instrumented.",
|
||||
)))
|
||||
} else {
|
||||
let s = random_corpus_id!(state.corpus(), state.rand_mut());
|
||||
|
||||
|
@ -86,6 +86,7 @@ rustversion = "1.0"
|
||||
|
||||
[dependencies]
|
||||
libafl_derive = { version = "0.11.2", optional = true, path = "../libafl_derive" }
|
||||
static_assertions = "1.1.0"
|
||||
|
||||
rustversion = "1.0"
|
||||
tuple_list = { version = "0.1.3" }
|
||||
|
@ -49,7 +49,7 @@ macro_rules! impl_asany {
|
||||
#[must_use]
|
||||
pub const fn pack_type_id(id: u128) -> TypeId {
|
||||
// TypeId size of other sizes is not yet supported"
|
||||
assert!(size_of::<TypeId>() == 16, "Unsupported size for TypeId");
|
||||
static_assertions::const_assert!(size_of::<TypeId>() == 16);
|
||||
unsafe { *(addr_of!(id) as *const TypeId) }
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ pub const fn pack_type_id(id: u128) -> TypeId {
|
||||
pub const fn unpack_type_id(id: TypeId) -> u128 {
|
||||
// see any.rs, it's alway u128 hence 16 bytes.
|
||||
// TypeId size of other sizes is not yet supported"
|
||||
assert!(size_of::<TypeId>() == 16, "Unsupported size for TypeId");
|
||||
static_assertions::const_assert!(size_of::<TypeId>() == 16);
|
||||
let ret: u128 = unsafe { read_unaligned::<u128>(addr_of!(id) as *const u128) };
|
||||
ret
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user