Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
PTAL, this is a small change requested/suggested by Mitch. I have another one ready (which is a large refactoring) that would come after.
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
115 | Why not just: std::string ConsumeRandomLengthString(size_t max_length = remaining_bytes_) {? |
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
115 | I don't think a non-const value can be used for the default argument |
LGTM w/ one comment
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
115 | Maybe I'm being silly, but this shouldn't be an issue, no? https://godbolt.org/z/46E8ht |
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
115 | hm, looks like it's not necessarily should be const, but anyhow it can't be a "non-static data member" In file included from <...>/llvm-project/compiler-rt/lib/fuzzer/tests/FuzzedDataProviderUnittest.cpp:9: <...>/llvm-build/lib/clang/11.0.0/include/fuzzer/FuzzedDataProvider.h:115:61: error: invalid use of non-static data member 'remaining_bytes_' std::string ConsumeRandomLengthString(size_t max_length = remaining_bytes_) { ^~~~~~~~~~~~~~~~ 1 error generated. same in gcc: https://godbolt.org/z/DdVHv4 |
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
115 | TIL - LGTM. |
Why not just:
std::string ConsumeRandomLengthString(size_t max_length = remaining_bytes_) {?