-
-
Notifications
You must be signed in to change notification settings - Fork 435
unwrap () has been replaced with meaning lib:afl errors and proper error propagation across the corpus folder wherever it is required #1908 #3696
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
…r propagation across the corpus folder whereever it is required AFLplusplus#1908
| .pop_front() | ||
| .ok_or_else(|| { | ||
| Error::illegal_state( | ||
| "Cache eviction: VecDeque empty despite length check", |
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.
how could this ever happen?
| if let Some(prev_node) = self.map.get_mut(&prev) { | ||
| prev_node.next = item.next; | ||
| } else { | ||
| debug_assert!(false, "List corrupted: prev {prev} missing"); |
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.
what's a debug assert? Did you vibe code this?
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.
Sorry for this,as I was a newbie ,I really couldn't get where to start , I was just willing to make contributions, so I have used vibe coding 😆
If you could give some examples, it would be more helpful for me.
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 vibe coding is allowed https://github.com/AFLplusplus/LibAFL/blob/main/CONTRIBUTING.md#on-ai-assistance
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.
Ok sorry for that, please can you give some examples, so that I can know what type of error message can be replaced instead of unwrap as per requirement.
| fn add(&mut self, testcase: Testcase<I>) -> Result<CorpusId, Error> { | ||
| let id = self.inner.add(testcase)?; | ||
| let testcase = &mut self.get(id).unwrap().borrow_mut(); | ||
| let testcase = &mut self.get(id)?.borrow_mut(); |
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.
Can you explain to me how this could ever happen? we liteally just added it
|
Sorry. Some of the changes might be actually useful and correct, but so far all that I looked at did not appear to be? There's no point in blindly applying rules for code paths that can never happen. |
Description
unwrap () has been replaced with meaningful libafl::errors and proper error handling across corpus folder, mainly the changed files are,
Checklist
./scripts/precommit.shand addressed all comments