Patchwork D7560: fuzz: always define LLVMFuzzerInitialize() even if we don't need it

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2019, 4 a.m.
Message ID <08ca94346ab70d758f1913a217e83c0e@localhost.localdomain>
Download mbox | patch
Permalink /patch/43624/
State Not Applicable
Headers show

Comments

phabricator - Dec. 7, 2019, 4 a.m.
Closed by commit rHG0a56e5f26a52: fuzz: always define LLVMFuzzerInitialize() even if we don&#039;t need it (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7560?vs=18498&id=18511

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7560/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7560

AFFECTED FILES
  contrib/fuzz/bdiff.cc
  contrib/fuzz/mpatch.cc
  contrib/fuzz/xdiff.cc

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/contrib/fuzz/xdiff.cc b/contrib/fuzz/xdiff.cc
--- a/contrib/fuzz/xdiff.cc
+++ b/contrib/fuzz/xdiff.cc
@@ -14,6 +14,11 @@ 
 
 extern "C" {
 
+int LLVMFuzzerInitialize(int *argc, char ***argv)
+{
+	return 0;
+}
+
 int hunk_consumer(long a1, long a2, long b1, long b2, void *priv)
 {
 	// TODO: probably also test returning -1 from this when things break?
diff --git a/contrib/fuzz/mpatch.cc b/contrib/fuzz/mpatch.cc
--- a/contrib/fuzz/mpatch.cc
+++ b/contrib/fuzz/mpatch.cc
@@ -14,6 +14,11 @@ 
 
 #include "fuzzutil.h"
 
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
+{
+	return 0;
+}
+
 // To avoid having too many OOMs from the fuzzer infrastructure, we'll
 // skip patch application if the resulting fulltext would be bigger
 // than 10MiB.
diff --git a/contrib/fuzz/bdiff.cc b/contrib/fuzz/bdiff.cc
--- a/contrib/fuzz/bdiff.cc
+++ b/contrib/fuzz/bdiff.cc
@@ -14,6 +14,11 @@ 
 extern "C" {
 #include "bdiff.h"
 
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
+{
+	return 0;
+}
+
 int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
 {
 	FuzzedDataProvider provider(Data, Size);