Add ERRORK opcode to trigger constant errors

This commit is contained in:
Emanuele Torre authored and Nico Williams committed 2023-08-04 11:47:34 -05:00
1 parent 71941a0d47
commit 5fc5453409
4 files changed
+16

No files matched your search

+6
View File
@@ -405,6 +405,12 @@ jv jq_next(jq_state *jq) {
case TOP: break;
case ERRORK: {
jv v = jv_array_get(jv_copy(frame_current(jq)->bc->constants), *pc++);
set_error(jq, jv_invalid_with_msg(v));
goto do_backtrack;
}
case LOADK: {
jv v = jv_array_get(jv_copy(frame_current(jq)->bc->constants), *pc++);
assert(jv_is_valid(v));