[PATCH] D74359: [compiler-rt] FuzzedDataProvider: add ConsumeData method.
Jonathan Metzman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 11 14:13:36 PST 2020
metzman added inline comments.
================
Comment at: compiler-rt/include/fuzzer/FuzzedDataProvider.h:246
+ // fuzzing data.
+ size_t ConsumeData(void *destination, size_t num_bytes) {
+ num_bytes = std::min(num_bytes, remaining_bytes_);
----------------
Dor1s wrote:
> metzman wrote:
> > Might be better not to use the same name "Consume" as other methods since this method is used a bit differently than other methods which return their value.
> Hmm... I agree it's different, but what would be a good alternative? `Copy` or `Write` are also not very intuitive as the internal pointer gets advanced and the data is in fact being consumed.
>
> Also feels like we could just get rid of the `Consume` prefix for all the methods, but it's too late now :D
>
Don't have an alternative. Probably best to leave as is.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74359/new/
https://reviews.llvm.org/D74359
More information about the llvm-commits
mailing list