Skip to content

Conversation

@KARTHIK-SH-5
Copy link

Description

unwrap () has been replaced with meaningful libafl::errors and proper error handling across corpus folder, mainly the changed files are,

inmemory.rs
inmemory_ondisk.rs
testcase.rs
minimizer.rs
cached.rs
unwrap () is mainly replaced by ?,ok_or_else (),libafl::errors and with match in rare case.

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

.pop_front()
.ok_or_else(|| {
Error::illegal_state(
"Cache eviction: VecDeque empty despite length check",
Copy link
Member

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");
Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

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();
Copy link
Member

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

@domenukk
Copy link
Member

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.
Don't take it personally, but I'll have to close this for now. Thanks any ways

@domenukk domenukk closed this Jan 24, 2026
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