-
Notifications
You must be signed in to change notification settings - Fork 164
feat: add hooks for Set.contains & Set.remove #1030
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
Conversation
simonresch
left a comment
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.
Looks good!
What do you think about adding a test similar to https://github.com/CodeIntelligenceTesting/jazzer/blob/main/tests/src/test/java/com/example/MapFuzzer.java?
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
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.
Pull request overview
This PR adds instrumentation hooks for Set.contains() and Set.remove() operations to improve fuzzing feedback by tracing comparisons with nearby elements when lookups fail.
Key Changes:
- Adds two new method hooks for
Set.containsandSet.removethat trigger when operations return false - Refactors existing map key lookup logic into a reusable
getLowerUpperBoundshelper method - Generalizes the
NavigableMapcheck (previouslyTreeMap) to support broader map implementations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java
Outdated
Show resolved
Hide resolved
eddf0b7 to
720bfa2
Compare
simonresch
left a comment
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.
Looks good, thanks!
720bfa2 to
1a83c2d
Compare
Add hooks for
Set.contains(...)andSet.remove(...)