[PATCH] D20741: [LibFuzzer] Reimplement how the optional user functions are called.

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 18:17:27 PDT 2016


kcc added a comment.

we are converging! :)


================
Comment at: lib/Fuzzer/FuzzerExtFunctions.def:19
@@ +18,3 @@
+EXT_FUNC(LLVMFuzzerInitialize, int, (int *argc, char ***argv), false);
+EXT_FUNC(LLVMFuzzerCustomMutator, size_t, (uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed) ,false);
+
----------------
s/ ,false/, false

================
Comment at: lib/Fuzzer/FuzzerExtFunctions.h:22
@@ +21,3 @@
+  // will be set to nullptr.
+  void Init();
+
----------------
Why not ExternalFunctions::ExternalFunctions? 

================
Comment at: lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp:48
@@ +47,3 @@
+}
+}
+#endif // LIBFUZZER_APPLE
----------------
}  // namespace fuzzer

================
Comment at: lib/Fuzzer/FuzzerExtFunctionsWeak.cpp:21
@@ +20,3 @@
+extern "C" {
+// Declare these symbols as weak to allow them to be optionally defined.
+__attribute__((weak)) int LLVMFuzzerInitialize(int *argc, char ***argv);
----------------
can you also use FuzzerExtFunctions.def here? 

================
Comment at: lib/Fuzzer/FuzzerMain.cpp:12
@@ -11,2 +11,3 @@
 
+#include "FuzzerExtFunctions.h"
 #include "FuzzerInterface.h"
----------------
do you still need this? 

================
Comment at: lib/Fuzzer/test/FuzzerUnittest.cpp:4
@@ -3,2 +3,3 @@
 
+#include "FuzzerExtFunctions.h"
 #include "FuzzerInternal.h"
----------------
do you still need this? 


http://reviews.llvm.org/D20741





More information about the llvm-commits mailing list