Repository navigation
fuzz: Use std::span in FuzzBufferType - #30229
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, |
dergoegge
left a comment
There was a problem hiding this comment.
utACK fabc9b02331ad6d5cbae3d351721e7e5d9585df0
|
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. |
The use of
Spanis 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 thatSpanwill be removed anyway in the long term.