Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 46272 Build 48634: arc lint + arc unit
Event Timeline
Jonathan @metzman please take a look when you get a chance. I'll add the tests later. Two comments:
- ConsumeMemory was requested by the users a few times and I think makes sense
- hash is my own idea and I'm not sure it's a good one. What's your opinion?
Thank you!
Mostly LGTM.
What's hash for? To seed an RNG?
I'm not 100% hashing the whole array is the right way to do things but it might be better than nothing.
I guess changing this is possible but not ideal since corpus elements won't map to the same behavior if we change it to say, the last byte or something similar.
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
252 | I think saying "Not recommended in general" is a bit weird. What's wrong with it for the intended purpose? | |
255 | I think we need to include <functional> to use std::hash right? | |
256 | I would guess this will be a long way off. |
Thanks for the review. I can't think of a good application for the hash. Anything I come up with is better to be done either without hashing or even without FDP.
- Removed the hash
- Added test
- Renamed ConsumeMemory to ConsumeData, as the former sounds a bit ambiguous (like memory consumption is more about memory being allocated, while here it's just values being copied, i.e. data)
I'm gonna rebase and commit, since there isn't much to review compared to the PS#1 (just a test).
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
252 | yeah, this is one more argument not to add such method, deleted | |
255 | good catch, I've also forgot <> for the template parameter, but anyway it's deleted now. |
still LGTM
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
246 | 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. |
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
246 | 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 |
compiler-rt/include/fuzzer/FuzzedDataProvider.h | ||
---|---|---|
246 | Don't have an alternative. Probably best to leave as is. |
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.