diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile --- a/contrib/fuzz/Makefile +++ b/contrib/fuzz/Makefile @@ -18,19 +18,19 @@ x%.o: ../../mercurial/thirdparty/xdiff/x -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 diff --git a/contrib/fuzz/xdiff.cc b/contrib/fuzz/xdiff.cc --- a/contrib/fuzz/xdiff.cc +++ b/contrib/fuzz/xdiff.cc @@ -37,20 +37,13 @@ int LLVMFuzzerTestOneInput(const uint8_t 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.