mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
fa637fcecb
This enables the minify fuzzer, which has been disabled because it did not pass the oss-fuzz instrumentation test. Now it does, after changes in simdjson (https://github.com/lemire/simdjson/issues/186). * get minify running (api change) * disable benchmarks when compiling fuzzers * catch exceptions from the minify fuzzer * enable repeated corpus creation without recursive inclusion of zip * remove leftover comment
22 lines
477 B
C++
22 lines
477 B
C++
#include "simdjson.h"
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
|
|
auto begin = (const char *)Data;
|
|
auto end = begin + Size;
|
|
|
|
std::string str(begin, end);
|
|
|
|
try {
|
|
simdjson::dom::parser parser;
|
|
simdjson::dom::element doc = parser.parse(str);
|
|
std::string minified=simdjson::minify(doc);
|
|
(void)minified;
|
|
} catch (...) {
|
|
|
|
}
|
|
return 0;
|
|
}
|