jameysharp opened PR #4495 from table-ops-zeros
to main
:
I noticed that
TableOp::insert
had assertions thatnum_params
and
table_size
were greater than 0, but no assert fornum_globals
. These
asserts couldn't be hit because the*_RANGE
constants were all set to
a minimum of 1.But the only reason I can see to prohibit 0-sized tables, locals, or
globals, was because indexes into those spaces were generated with the
%
operator. Allowing 0-sized spaces requires not generating the
corresponding instructions at all when there are no valid indexes.So I pushed the final selection of which table/local/global to access
earlier, to the moment when we're picking which TableOps to run. Then,
instead of generating a random u8 or u32 and taking the remainder to get
it into the right range, I can just askarbitrary
to generate a number
in the right range to begin with.So this now explores some size-0 corners that it didn't before, and it
doesn't require reasoning about whether remainder can divide by zero.
Also I think it uses fewer bits of theUnstructured
input to produce
the same cases, and I hope that lets libFuzzer more quickly find bits it
can mutate to get to novel coverage paths.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jameysharp requested fitzgen for a review on PR #4495.
fitzgen submitted PR review.
jameysharp updated PR #4495 from table-ops-zeros
to main
.
jameysharp has enabled auto merge for PR #4495.
jameysharp merged PR #4495.
Last updated: Dec 23 2024 at 12:05 UTC