-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TypeRefCreator trait #2065
Add TypeRefCreator trait #2065
Conversation
like this? @addisoncrump |
i didn't implement it for all the struct but just implemented for what is needed now |
I would do a |
Can I modify this @tokatoka? There's a nicer way to do this that requires fewer modifications |
yes |
Now it should just automagically work for all types that get entered into tuples and searched by |
great 👍 |
fuzzers/forkserver_simple/harness
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 Just messing with you. We should probably gitignore these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but how do we check if it's executable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean these exact file names. You just did cargo make
or something, right?
How about calling the guy |
Also, as mentioned before, I think the ref should directly contain the name, So a real |
@addisoncrump |
Sure thing. |
Note that the Named trait now requires alloc. This is to allow for avoiding a clone whenever using |
this is ready? |
orig_hash: u64, | ||
phantom: PhantomData<(M, S)>, | ||
} | ||
|
||
impl<M, S> MapEqualityFeedback<M, S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this guy got deleted for mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, not accidental -- this one should not be publicly exposed.
@tokatoka It's not ready, no, I'm working through CI fixes. |
libafl_bolts/src/tuples.rs
Outdated
@@ -524,6 +526,47 @@ where | |||
} | |||
} | |||
|
|||
/// Structs that has `TypeRef` | |||
/// You should use this when you want to avoid specifying types using `match_name_type_mut` | |||
pub trait TypeRefCreator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referenceable
?
can you finish this @addisoncrump |
then alloc shouldn't be a feature anymore? |
This makes it hard to use. For example if we do like this
Then this code from forkserver_libafl_cc won't compile
because edges_observer is moved to the |
@tokatoka in that case, you can clone the Cow and only if necessary will it create a memory reference. It can be safely held without reference to the original observer. #[derive(Debug, Clone)]
#[cfg(feature = "alloc")]
pub struct TypeRef<T: ?Sized> {
name: Cow<'static, str>,
phantom: PhantomData<T>,
} |
And yes, please finish this without me, I am currently rushing a paper submission 😵💫 |
#[cfg(feature = "alloc")] | ||
pub trait Referenceable: Named { | ||
/// Return the `ReReference ` | ||
fn type_ref(&self) -> ReReference<Self> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReReference? :D
No description provided.