-
Notifications
You must be signed in to change notification settings - Fork 37.8k
fuzz: Use std::span in FuzzBufferType #30229
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
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
I'm out of the loop on converting |
Good question! It is quite some work to do it everywhere (I am working on it), because However, as long as the replacement compiles, it should be safe. Moreover, |
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.
utACK fabc9b0
I think this is ok to do, but you'll need adjust the bitset code instroduced in #30160: test/fuzz/bitset.cpp:284:23: error: no matching function for call to 'ReadByte'
unsigned typdat = ReadByte(buffer) % 8;
^~~~~~~~
test/fuzz/bitset.cpp:16:9: note: candidate function not viable: no known conversion from 'FuzzBufferType' (aka 'span<const unsigned char>') to 'Span<const uint8_t> &' (aka 'Span<const unsigned char> &') for 1st argument
uint8_t ReadByte(Span<const uint8_t>& buffer)
^
1 error generated. |
Thanks for spotting the silent merge conflict. Rebased. |
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.
utACK faa41e2
The use of
Span
is problematic, because it lacks methods such asrbegin
, leading to compile failures when used:One could fix
Span
, but it seems better to usestd::span
, given thatSpan
will be removed anyway in the long term.