2020-03-03 06:23:19 +08:00
|
|
|
#include "simdjson.h"
|
2019-10-29 02:46:57 +08:00
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
|
|
|
2020-04-13 00:47:24 +08:00
|
|
|
auto begin = (const char *)Data;
|
|
|
|
auto end = begin + Size;
|
2019-10-29 02:46:57 +08:00
|
|
|
|
2020-04-13 00:47:24 +08:00
|
|
|
std::string str(begin, end);
|
2020-04-16 04:45:36 +08:00
|
|
|
#if SIMDJSON_EXCEPTIONS
|
2020-04-13 00:47:24 +08:00
|
|
|
try {
|
|
|
|
simdjson::dom::parser parser;
|
|
|
|
simdjson::dom::element doc = parser.parse(str);
|
|
|
|
std::string minified=simdjson::minify(doc);
|
|
|
|
(void)minified;
|
|
|
|
} catch (...) {
|
|
|
|
|
|
|
|
}
|
2020-04-16 04:45:36 +08:00
|
|
|
#endif
|
2020-04-13 00:47:24 +08:00
|
|
|
return 0;
|
2019-10-29 02:46:57 +08:00
|
|
|
}
|