diff --git a/jsonexamples/invalid/nully_trailing.json b/jsonexamples/invalid/nully_trailing.json new file mode 100644 index 0000000..ac59ceb --- /dev/null +++ b/jsonexamples/invalid/nully_trailing.json @@ -0,0 +1 @@ +nully trailing diff --git a/spec/compile_spec.lua b/spec/compile_spec.lua index 22e191b..4714d99 100644 --- a/spec/compile_spec.lua +++ b/spec/compile_spec.lua @@ -108,10 +108,11 @@ end local invalid_files = { "bool_trailing.json", + "nully_trailing.json", "nil_token.json", - -- "nil_token_scalar.json", + "nil_token_scalar.json", "nully_token.json", - -- "nully_token_scalar.json" + "nully_token_scalar.json" } describe("Make sure invalid files are not accepted", function() diff --git a/src/luasimdjson.cpp b/src/luasimdjson.cpp index fe7ddf9..5c55b57 100644 --- a/src/luasimdjson.cpp +++ b/src/luasimdjson.cpp @@ -124,6 +124,9 @@ void convert_ondemand_element_to_table(lua_State *L, T& element) { // calling is_null().value() will trigger an exception if the value is invalid if (element.is_null().value()) { lua_pushlightuserdata(L, NULL); + } else { + // workaround for simdjson 3.10.1 + throw simdjson_error(INCORRECT_TYPE); } break; }