changeset 36765:04d64163039a

fuzz: fix xdiff build Recent xdiff code cleanups removed some files and changed some structures. Update fuzz code. Differential Revision: https://phab.mercurial-scm.org/D2707
author Jun Wu <quark@fb.com>
date Tue, 06 Mar 2018 19:31:17 -0800
parents 3cf40112efb7
children d382344c69aa
files contrib/fuzz/Makefile contrib/fuzz/xdiff.cc
diffstat 2 files changed, 4 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/fuzz/Makefile	Tue Mar 06 18:51:11 2018 -0800
+++ b/contrib/fuzz/Makefile	Tue Mar 06 19:31:17 2018 -0800
@@ -18,19 +18,19 @@
 	  -o $@ \
 	  $<
 
-xdiff: xdiff.cc xdiffi.o  xemit.o  xmerge.o  xprepare.o  xutils.o
+xdiff: xdiff.cc xdiffi.o xprepare.o  xutils.o
 	clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
 	  -I../../mercurial xdiff.cc \
-	  xdiffi.o xemit.o xmerge.o xprepare.o xutils.o -o xdiff
+	  xdiffi.o xprepare.o xutils.o -o xdiff
 
 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
 	$$CC $$CFLAGS -c \
 	  -o $@ \
 	  $<
 
-xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o  fuzz-xemit.o  fuzz-xmerge.o  fuzz-xprepare.o  fuzz-xutils.o
+xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o  fuzz-xutils.o
 	$$CXX $$CXXFLAGS -std=c++11 -I../../mercurial xdiff.cc \
-	  fuzz-xdiffi.o fuzz-xemit.o fuzz-xmerge.o fuzz-xprepare.o fuzz-xutils.o \
+	  fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
 	  -lFuzzingEngine -o $$OUT/xdiff_fuzzer
 
 all: bdiff xdiff
--- a/contrib/fuzz/xdiff.cc	Tue Mar 06 18:51:11 2018 -0800
+++ b/contrib/fuzz/xdiff.cc	Tue Mar 06 19:31:17 2018 -0800
@@ -37,20 +37,13 @@
 	b.size = Size - split;
 	xpparam_t xpp = {
 	    XDF_INDENT_HEURISTIC, /* flags */
-	    NULL,                 /* anchors */
-	    0,                    /* anchors_nr */
 	};
 	xdemitconf_t xecfg = {
-	    0,                  /* ctxlen */
-	    0,                  /* interhunkctxlen */
 	    XDL_EMIT_BDIFFHUNK, /* flags */
-	    NULL,               /* find_func */
-	    NULL,               /* find_func_priv */
 	    hunk_consumer,      /* hunk_consume_func */
 	};
 	xdemitcb_t ecb = {
 	    NULL, /* priv */
-	    NULL, /* outf */
 	};
 	xdl_diff(&a, &b, &xpp, &xecfg, &ecb);
 	return 0; // Non-zero return values are reserved for future use.