Skip to content
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 RefCellValueObserver #1363

Merged
merged 3 commits into from
Jul 13, 2023
Merged

Add RefCellValueObserver #1363

merged 3 commits into from
Jul 13, 2023

Conversation

addisoncrump
Copy link
Collaborator

RefCell is not Hash (and cannot be Hash), which prevents it from being used with NewHashFeedback. This provides an implementation which allows access to an internal RefCell'd value.

Copy link
Contributor

@langston-barrett langston-barrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to implement

impl<'a, T: Hash> ObserverWithHashField for ValueObserver<'a, RefCell<T>>

instead? Seems like this would acoid duplicating other instances.

libafl/src/observers/value.rs Outdated Show resolved Hide resolved
@addisoncrump
Copy link
Collaborator Author

Is it possible to implement

impl<'a, T: Hash> ObserverWithHashField for ValueObserver<'a, RefCell<T>>

instead? Seems like this would acoid duplicating other instances.

Sadly no. Since "the developers of the RefCell-providing library may in the future decide to impl Hash for RefCell", we cannot do this. Was the first thing I tried and was so sad to see that compiler error 😅

@domenukk domenukk merged commit f76331e into main Jul 13, 2023
@domenukk domenukk deleted the refcell-valueobs branch July 13, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants