I added a new flag RunningCB to know if the Fuzzer's main thread is running the CB function, instead of using (! CurrentUnitSize). (! CurrentUnitSize) doesn't work properly. For example, in FuzzerLoop.cpp, inside ShuffleAndMinimize() function, we execute the callback with an empty string (size=0). Previous implementation failed to detect timeouts in that execution.
Also, I add a regression test for that case.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM with a nit
lib/Fuzzer/test/TimeoutEmptyTest.cpp | ||
---|---|---|
9 | This is fragile and may be optimized away. static volatile int zero = 0; if (!size) while(!zero) ; |
This is fragile and may be optimized away.
Instead do this: