[PATCH] D27238: [libFuzzer] Diff 7 - Improve Signal Handler interface.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 12:04:28 PST 2016


mpividori added inline comments.


================
Comment at: lib/Fuzzer/FuzzerUtil.h:44
 // Platform specific functions.
-void SetTimer(int Seconds);
-
-void SetSigSegvHandler();
-void SetSigBusHandler();
-void SetSigAbrtHandler();
-void SetSigIllHandler();
-void SetSigFpeHandler();
-void SetSigIntHandler();
-void SetSigTermHandler();
+struct SignalHandlerOptions {
+  typedef void (*HandlerT)();
----------------
mpividori wrote:
> kcc wrote:
> > do you need this level of indirection?
> @kcc 
> + This way we make explicit which callback function will be registered for a specific signal. In previous implementation, when calling functions like `SetSigSegvHandler()`, it's not clear which callback will be called for that given signal.
> + With these changes we decouple the implementation of FuzzerUtils from the rest of the Fuzzer's implementation. In fact, you can see I remove the includes:   #include "FuzzerInternal.h"   from the FuzzerUtil*.cpp implementations.
> + This changes simplify the implementation of Windows's exception handling.
Hi @kcc ,
Would you agree with these changes?


Repository:
  rL LLVM

https://reviews.llvm.org/D27238





More information about the llvm-commits mailing list