Show More
@@ -1,184 +1,175 b'' | |||||
1 | CC = clang |
|
1 | CC = clang | |
2 | CXX = clang++ |
|
2 | CXX = clang++ | |
3 |
|
3 | |||
4 | all: bdiff mpatch xdiff |
|
4 | all: bdiff mpatch xdiff | |
5 |
|
5 | |||
6 | fuzzutil.o: fuzzutil.cc fuzzutil.h |
|
|||
7 | $(CXX) $(CXXFLAGS) -g -O1 \ |
|
|||
8 | -std=c++17 \ |
|
|||
9 | -I../../mercurial -c -o fuzzutil.o fuzzutil.cc |
|
|||
10 |
|
||||
11 | fuzzutil-oss-fuzz.o: fuzzutil.cc fuzzutil.h |
|
|||
12 | $(CXX) $(CXXFLAGS) -std=c++17 \ |
|
|||
13 | -I../../mercurial -c -o fuzzutil-oss-fuzz.o fuzzutil.cc |
|
|||
14 |
|
||||
15 | pyutil.o: pyutil.cc pyutil.h |
|
6 | pyutil.o: pyutil.cc pyutil.h | |
16 | $(CXX) $(CXXFLAGS) -g -O1 \ |
|
7 | $(CXX) $(CXXFLAGS) -g -O1 \ | |
17 | `$$OUT/sanpy/bin/python-config --cflags` \ |
|
8 | `$$OUT/sanpy/bin/python-config --cflags` \ | |
18 | -I../../mercurial -c -o pyutil.o pyutil.cc |
|
9 | -I../../mercurial -c -o pyutil.o pyutil.cc | |
19 |
|
10 | |||
20 | bdiff.o: ../../mercurial/bdiff.c |
|
11 | bdiff.o: ../../mercurial/bdiff.c | |
21 | $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ |
|
12 | $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ | |
22 | ../../mercurial/bdiff.c |
|
13 | ../../mercurial/bdiff.c | |
23 |
|
14 | |||
24 |
bdiff: bdiff.cc bdiff.o |
|
15 | bdiff: bdiff.cc bdiff.o | |
25 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
|
16 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | |
26 | -std=c++17 \ |
|
17 | -std=c++17 \ | |
27 |
-I../../mercurial bdiff.cc bdiff.o |
|
18 | -I../../mercurial bdiff.cc bdiff.o -o bdiff | |
28 |
|
19 | |||
29 | bdiff-oss-fuzz.o: ../../mercurial/bdiff.c |
|
20 | bdiff-oss-fuzz.o: ../../mercurial/bdiff.c | |
30 | $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c |
|
21 | $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c | |
31 |
|
22 | |||
32 |
bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o |
|
23 | bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o | |
33 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ |
|
24 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ | |
34 |
bdiff-oss-fuzz.o |
|
25 | bdiff-oss-fuzz.o -lFuzzingEngine -o \ | |
35 | $$OUT/bdiff_fuzzer |
|
26 | $$OUT/bdiff_fuzzer | |
36 |
|
27 | |||
37 | mpatch.o: ../../mercurial/mpatch.c |
|
28 | mpatch.o: ../../mercurial/mpatch.c | |
38 | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \ |
|
29 | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \ | |
39 | ../../mercurial/mpatch.c |
|
30 | ../../mercurial/mpatch.c | |
40 |
|
31 | |||
41 | mpatch: CXXFLAGS += -std=c++17 |
|
32 | mpatch: CXXFLAGS += -std=c++17 | |
42 |
mpatch: mpatch.cc mpatch.o |
|
33 | mpatch: mpatch.cc mpatch.o | |
43 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
|
34 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | |
44 |
-I../../mercurial mpatch.cc mpatch.o |
|
35 | -I../../mercurial mpatch.cc mpatch.o -o mpatch | |
45 |
|
36 | |||
46 | mpatch-oss-fuzz.o: ../../mercurial/mpatch.c |
|
37 | mpatch-oss-fuzz.o: ../../mercurial/mpatch.c | |
47 | $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c |
|
38 | $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c | |
48 |
|
39 | |||
49 |
mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o |
|
40 | mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o | |
50 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ |
|
41 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ | |
51 |
mpatch-oss-fuzz.o |
|
42 | mpatch-oss-fuzz.o -lFuzzingEngine -o \ | |
52 | $$OUT/mpatch_fuzzer |
|
43 | $$OUT/mpatch_fuzzer | |
53 |
|
44 | |||
54 | mpatch_corpus.zip: |
|
45 | mpatch_corpus.zip: | |
55 | python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip |
|
46 | python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip | |
56 |
|
47 | |||
57 | x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
|
48 | x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | |
58 | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \ |
|
49 | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \ | |
59 | -o $@ \ |
|
50 | -o $@ \ | |
60 | $< |
|
51 | $< | |
61 |
|
52 | |||
62 | xdiff: CXXFLAGS += -std=c++17 |
|
53 | xdiff: CXXFLAGS += -std=c++17 | |
63 |
xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o |
|
54 | xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o | |
64 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
|
55 | $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | |
65 | -I../../mercurial xdiff.cc \ |
|
56 | -I../../mercurial xdiff.cc \ | |
66 |
xdiffi.o xprepare.o xutils.o |
|
57 | xdiffi.o xprepare.o xutils.o -o xdiff | |
67 |
|
58 | |||
68 | fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
|
59 | fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | |
69 | $(CC) $(CFLAGS) -c \ |
|
60 | $(CC) $(CFLAGS) -c \ | |
70 | -o $@ \ |
|
61 | -o $@ \ | |
71 | $< |
|
62 | $< | |
72 |
|
63 | |||
73 |
xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o |
|
64 | xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o | |
74 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ |
|
65 | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ | |
75 |
fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o |
|
66 | fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \ | |
76 | -lFuzzingEngine -o $$OUT/xdiff_fuzzer |
|
67 | -lFuzzingEngine -o $$OUT/xdiff_fuzzer | |
77 |
|
68 | |||
78 | manifest.o: ../../mercurial/cext/manifest.c |
|
69 | manifest.o: ../../mercurial/cext/manifest.c | |
79 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
70 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
80 | -I../../mercurial \ |
|
71 | -I../../mercurial \ | |
81 | -c -o manifest.o ../../mercurial/cext/manifest.c |
|
72 | -c -o manifest.o ../../mercurial/cext/manifest.c | |
82 |
|
73 | |||
83 | charencode.o: ../../mercurial/cext/charencode.c |
|
74 | charencode.o: ../../mercurial/cext/charencode.c | |
84 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
75 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
85 | -I../../mercurial \ |
|
76 | -I../../mercurial \ | |
86 | -c -o charencode.o ../../mercurial/cext/charencode.c |
|
77 | -c -o charencode.o ../../mercurial/cext/charencode.c | |
87 |
|
78 | |||
88 | parsers.o: ../../mercurial/cext/parsers.c |
|
79 | parsers.o: ../../mercurial/cext/parsers.c | |
89 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
80 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
90 | -I../../mercurial \ |
|
81 | -I../../mercurial \ | |
91 | -c -o parsers.o ../../mercurial/cext/parsers.c |
|
82 | -c -o parsers.o ../../mercurial/cext/parsers.c | |
92 |
|
83 | |||
93 | dirs.o: ../../mercurial/cext/dirs.c |
|
84 | dirs.o: ../../mercurial/cext/dirs.c | |
94 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
85 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
95 | -I../../mercurial \ |
|
86 | -I../../mercurial \ | |
96 | -c -o dirs.o ../../mercurial/cext/dirs.c |
|
87 | -c -o dirs.o ../../mercurial/cext/dirs.c | |
97 |
|
88 | |||
98 | pathencode.o: ../../mercurial/cext/pathencode.c |
|
89 | pathencode.o: ../../mercurial/cext/pathencode.c | |
99 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
90 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
100 | -I../../mercurial \ |
|
91 | -I../../mercurial \ | |
101 | -c -o pathencode.o ../../mercurial/cext/pathencode.c |
|
92 | -c -o pathencode.o ../../mercurial/cext/pathencode.c | |
102 |
|
93 | |||
103 | revlog.o: ../../mercurial/cext/revlog.c |
|
94 | revlog.o: ../../mercurial/cext/revlog.c | |
104 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
95 | $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
105 | -I../../mercurial \ |
|
96 | -I../../mercurial \ | |
106 | -c -o revlog.o ../../mercurial/cext/revlog.c |
|
97 | -c -o revlog.o ../../mercurial/cext/revlog.c | |
107 |
|
98 | |||
108 | dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
99 | dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
109 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
100 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
110 | -Wno-register -Wno-macro-redefined \ |
|
101 | -Wno-register -Wno-macro-redefined \ | |
111 | -I../../mercurial dirs.cc \ |
|
102 | -I../../mercurial dirs.cc \ | |
112 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
103 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
113 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
104 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
114 | -o $$OUT/dirs_fuzzer |
|
105 | -o $$OUT/dirs_fuzzer | |
115 |
|
106 | |||
116 | fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
107 | fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
117 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
108 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
118 | -Wno-register -Wno-macro-redefined \ |
|
109 | -Wno-register -Wno-macro-redefined \ | |
119 | -I../../mercurial fncache.cc \ |
|
110 | -I../../mercurial fncache.cc \ | |
120 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
111 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
121 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
112 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
122 | -o $$OUT/fncache_fuzzer |
|
113 | -o $$OUT/fncache_fuzzer | |
123 |
|
114 | |||
124 | jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
115 | jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
125 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
116 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
126 | -Wno-register -Wno-macro-redefined \ |
|
117 | -Wno-register -Wno-macro-redefined \ | |
127 | -I../../mercurial jsonescapeu8fast.cc \ |
|
118 | -I../../mercurial jsonescapeu8fast.cc \ | |
128 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
119 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
129 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
120 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
130 | -o $$OUT/jsonescapeu8fast_fuzzer |
|
121 | -o $$OUT/jsonescapeu8fast_fuzzer | |
131 |
|
122 | |||
132 | manifest_corpus.zip: |
|
123 | manifest_corpus.zip: | |
133 | python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip |
|
124 | python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip | |
134 |
|
125 | |||
135 | manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
126 | manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
136 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
127 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
137 | -Wno-register -Wno-macro-redefined \ |
|
128 | -Wno-register -Wno-macro-redefined \ | |
138 | -I../../mercurial manifest.cc \ |
|
129 | -I../../mercurial manifest.cc \ | |
139 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
130 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
140 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
131 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
141 | -o $$OUT/manifest_fuzzer |
|
132 | -o $$OUT/manifest_fuzzer | |
142 |
|
133 | |||
143 | revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
134 | revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
144 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
135 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
145 | -Wno-register -Wno-macro-redefined \ |
|
136 | -Wno-register -Wno-macro-redefined \ | |
146 | -I../../mercurial revlog.cc \ |
|
137 | -I../../mercurial revlog.cc \ | |
147 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
138 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
148 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
139 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
149 | -o $$OUT/revlog_fuzzer |
|
140 | -o $$OUT/revlog_fuzzer | |
150 |
|
141 | |||
151 | revlog_corpus.zip: |
|
142 | revlog_corpus.zip: | |
152 | python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip |
|
143 | python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip | |
153 |
|
144 | |||
154 | dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
145 | dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
155 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
146 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
156 | -Wno-register -Wno-macro-redefined \ |
|
147 | -Wno-register -Wno-macro-redefined \ | |
157 | -I../../mercurial dirstate.cc \ |
|
148 | -I../../mercurial dirstate.cc \ | |
158 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
149 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
159 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
150 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
160 | -o $$OUT/dirstate_fuzzer |
|
151 | -o $$OUT/dirstate_fuzzer | |
161 |
|
152 | |||
162 | dirstate_corpus.zip: |
|
153 | dirstate_corpus.zip: | |
163 | python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip |
|
154 | python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip | |
164 |
|
155 | |||
165 | fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
|
156 | fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o | |
166 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ |
|
157 | $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \ | |
167 | -Wno-register -Wno-macro-redefined \ |
|
158 | -Wno-register -Wno-macro-redefined \ | |
168 | -I../../mercurial fm1readmarkers.cc \ |
|
159 | -I../../mercurial fm1readmarkers.cc \ | |
169 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
|
160 | manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ | |
170 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ |
|
161 | -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \ | |
171 | -o $$OUT/fm1readmarkers_fuzzer |
|
162 | -o $$OUT/fm1readmarkers_fuzzer | |
172 |
|
163 | |||
173 | fm1readmarkers_corpus.zip: |
|
164 | fm1readmarkers_corpus.zip: | |
174 | python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip |
|
165 | python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip | |
175 |
|
166 | |||
176 | clean: |
|
167 | clean: | |
177 | $(RM) *.o *_fuzzer \ |
|
168 | $(RM) *.o *_fuzzer \ | |
178 | bdiff \ |
|
169 | bdiff \ | |
179 | mpatch \ |
|
170 | mpatch \ | |
180 | xdiff |
|
171 | xdiff | |
181 |
|
172 | |||
182 | oss-fuzz: bdiff_fuzzer mpatch_fuzzer mpatch_corpus.zip xdiff_fuzzer dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer manifest_corpus.zip revlog_fuzzer revlog_corpus.zip dirstate_fuzzer dirstate_corpus.zip fm1readmarkers_fuzzer fm1readmarkers_corpus.zip |
|
173 | oss-fuzz: bdiff_fuzzer mpatch_fuzzer mpatch_corpus.zip xdiff_fuzzer dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer manifest_corpus.zip revlog_fuzzer revlog_corpus.zip dirstate_fuzzer dirstate_corpus.zip fm1readmarkers_fuzzer fm1readmarkers_corpus.zip | |
183 |
|
174 | |||
184 | .PHONY: all clean oss-fuzz |
|
175 | .PHONY: all clean oss-fuzz |
@@ -1,47 +1,37 b'' | |||||
1 | #ifndef CONTRIB_FUZZ_FUZZUTIL_H |
|
1 | #ifndef CONTRIB_FUZZ_FUZZUTIL_H | |
2 | #define CONTRIB_FUZZ_FUZZUTIL_H |
|
2 | #define CONTRIB_FUZZ_FUZZUTIL_H | |
3 | #include <iostream> |
|
3 | #include <iostream> | |
4 | #include <memory> |
|
4 | #include <memory> | |
5 | #include <stdint.h> |
|
5 | #include <stdint.h> | |
6 |
|
6 | |||
7 | /* Try and use std::optional, but failing that assume we'll have a |
|
7 | /* Try and use std::optional, but failing that assume we'll have a | |
8 | * workable https://abseil.io/ install on the include path to get |
|
8 | * workable https://abseil.io/ install on the include path to get | |
9 | * their backport of std::optional. */ |
|
9 | * their backport of std::optional. */ | |
10 | #ifdef __has_include |
|
10 | #ifdef __has_include | |
11 | #if __has_include(<optional>) && __cplusplus >= 201703L |
|
11 | #if __has_include(<optional>) && __cplusplus >= 201703L | |
12 | #include <optional> |
|
12 | #include <optional> | |
13 | #define CONTRIB_FUZZ_HAVE_STD_OPTIONAL |
|
13 | #define CONTRIB_FUZZ_HAVE_STD_OPTIONAL | |
14 | #endif |
|
14 | #endif | |
15 | #endif |
|
15 | #endif | |
16 | #ifdef CONTRIB_FUZZ_HAVE_STD_OPTIONAL |
|
16 | #ifdef CONTRIB_FUZZ_HAVE_STD_OPTIONAL | |
17 | namespace contrib |
|
17 | namespace contrib | |
18 | { |
|
18 | { | |
19 | using std::nullopt; |
|
19 | using std::nullopt; | |
20 | using std::optional; |
|
20 | using std::optional; | |
21 | } /* namespace contrib */ |
|
21 | } /* namespace contrib */ | |
22 | #else |
|
22 | #else | |
23 | #include "third_party/absl/types/optional.h" |
|
23 | #include "third_party/absl/types/optional.h" | |
24 | namespace contrib |
|
24 | namespace contrib | |
25 | { |
|
25 | { | |
26 | using absl::nullopt; |
|
26 | using absl::nullopt; | |
27 | using absl::optional; |
|
27 | using absl::optional; | |
28 | } /* namespace contrib */ |
|
28 | } /* namespace contrib */ | |
29 | #endif |
|
29 | #endif | |
30 |
|
30 | |||
31 | /* set DEBUG to 1 for a few debugging prints, or 2 for a lot */ |
|
31 | /* set DEBUG to 1 for a few debugging prints, or 2 for a lot */ | |
32 | #define DEBUG 0 |
|
32 | #define DEBUG 0 | |
33 | #define LOG(level) \ |
|
33 | #define LOG(level) \ | |
34 | if (level <= DEBUG) \ |
|
34 | if (level <= DEBUG) \ | |
35 | std::cout |
|
35 | std::cout | |
36 |
|
36 | |||
37 | struct two_inputs { |
|
|||
38 | std::unique_ptr<char[]> right; |
|
|||
39 | size_t right_size; |
|
|||
40 | std::unique_ptr<char[]> left; |
|
|||
41 | size_t left_size; |
|
|||
42 | }; |
|
|||
43 |
|
||||
44 | /* Split a non-zero-length input into two inputs. */ |
|
|||
45 | contrib::optional<two_inputs> SplitInputs(const uint8_t *Data, size_t Size); |
|
|||
46 |
|
||||
47 | #endif /* CONTRIB_FUZZ_FUZZUTIL_H */ |
|
37 | #endif /* CONTRIB_FUZZ_FUZZUTIL_H */ |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now