Conversation
b961af8 to
960fad5
Compare
960fad5 to
1b7c5fe
Compare
| H3_EXPORT(constructCell) | ||
| (args->res, args->baseCellNumber, args->digits, &out); | ||
| if (args->res == 0) { | ||
| H3_EXPORT(constructCell) | ||
| (args->res, args->baseCellNumber, NULL, &out); | ||
| } |
There was a problem hiding this comment.
Just a (probably naive) question to improve my understanding of how to set up the fuzzers: I'm surprised we run an additional test if res == 0, as opposed to branching to a separate test on the value of res.
How does that work / why do we want to run both?
How would this compare to code like:
if (args->res == 0) {
H3_EXPORT(constructCell)
(args->res, args->baseCellNumber, NULL, &out);
} else {
H3_EXPORT(constructCell)
(args->res, args->baseCellNumber, args->digits, &out);
}Or, is the idea that the res == 0 branch provides a more targeted test that's more likely to find issues quickly because it is reducing the search space?
There was a problem hiding this comment.
I think if res is 0 and a non-NULL pointer is passed for digits it should still be accepted. The inverse is not true however, since the caller must provide an array of length res.
There was a problem hiding this comment.
I'm updating this to be clearer about why we are testing different digits lengths.
|
Makes sense, and this example helped me understand fuzzing a bit better :) |
| H3_EXPORT(constructCell) | ||
| (args->res, args->baseCellNumber, args->digits, &out); |
There was a problem hiding this comment.
Maybe this is just auto-formatting, but I find this hard to read compared with opening the parens on the previous line
There was a problem hiding this comment.
This is unfortunately how the auto-formatter wants to do it
Fixes #1067