Bug 1561346 - Allow FUZZING_INTERFACE_STREAM to be used multiple times. r=froydnj
authorChristian Holler <choller@mozilla.com>
Tue, 25 Jun 2019 22:02:52 +0000
changeset 480119 d9fc649ed2007ad35f103dacd7b3b73562c937eb
parent 480118 08d6d034d45b7b0bbf2e3a6a8e429eb0d3c5e5bc
child 480120 a3cad1d7836c6f84e33a895841ba0315460115bc
push id88514
push usercholler@mozilla.com
push dateTue, 25 Jun 2019 22:14:22 +0000
treeherderautoland@d9fc649ed200 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1561346
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1561346 - Allow FUZZING_INTERFACE_STREAM to be used multiple times. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D35824
tools/fuzzing/interface/FuzzingInterfaceStream.h
--- a/tools/fuzzing/interface/FuzzingInterfaceStream.h
+++ b/tools/fuzzing/interface/FuzzingInterfaceStream.h
@@ -58,30 +58,30 @@ void afl_interface_stream(const char* te
       ::mozilla::afl_interface_stream(testFile.c_str(), testFunc); \
     }
 #else
 #  define MOZ_AFL_INTERFACE_STREAM(initFunc, testFunc, moduleName) /* Nothing \
                                                                     */
 #endif
 
 #ifdef LIBFUZZER
-#  define MOZ_LIBFUZZER_INTERFACE_STREAM(initFunc, testFunc, moduleName)     \
-    static int LibFuzzerTest##moduleName(const uint8_t* data, size_t size) { \
-      if (size > INT32_MAX) return 0;                                        \
-      nsCOMPtr<nsIInputStream> stream;                                       \
-      nsresult rv = NS_NewByteInputStream(getter_AddRefs(stream),            \
-                                          MakeSpan((const char*)data, size), \
-                                          NS_ASSIGNMENT_DEPEND);             \
-      MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));                                  \
-      testFunc(stream.forget());                                             \
-      return 0;                                                              \
-    }                                                                        \
-    static void __attribute__((constructor)) LibFuzzerRegister() {           \
-      ::mozilla::FuzzerRegistry::getInstance().registerModule(               \
-          #moduleName, initFunc, LibFuzzerTest##moduleName);                 \
+#  define MOZ_LIBFUZZER_INTERFACE_STREAM(initFunc, testFunc, moduleName)       \
+    static int LibFuzzerTest##moduleName(const uint8_t* data, size_t size) {   \
+      if (size > INT32_MAX) return 0;                                          \
+      nsCOMPtr<nsIInputStream> stream;                                         \
+      nsresult rv = NS_NewByteInputStream(getter_AddRefs(stream),              \
+                                          MakeSpan((const char*)data, size),   \
+                                          NS_ASSIGNMENT_DEPEND);               \
+      MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));                                    \
+      testFunc(stream.forget());                                               \
+      return 0;                                                                \
+    }                                                                          \
+    static void __attribute__((constructor)) LibFuzzerRegister##moduleName() { \
+      ::mozilla::FuzzerRegistry::getInstance().registerModule(                 \
+          #moduleName, initFunc, LibFuzzerTest##moduleName);                   \
     }
 #else
 #  define MOZ_LIBFUZZER_INTERFACE_STREAM(initFunc, testFunc, \
                                          moduleName) /* Nothing */
 #endif
 
 #define MOZ_FUZZING_INTERFACE_STREAM(initFunc, testFunc, moduleName) \
   MOZ_LIBFUZZER_INTERFACE_STREAM(initFunc, testFunc, moduleName);    \