mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
6d7c77ddc1
* Tweaking code so that we can run all tests with exceptions off. * Removing SIMDJSON_DISABLE_EXCEPTIONS
23 lines
507 B
C++
23 lines
507 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);
|
|
#if SIMDJSON_EXCEPTIONS
|
|
try {
|
|
simdjson::dom::parser parser;
|
|
simdjson::dom::element doc = parser.parse(str);
|
|
std::string minified=simdjson::minify(doc);
|
|
(void)minified;
|
|
} catch (...) {
|
|
|
|
}
|
|
#endif
|
|
return 0;
|
|
}
|