eval: Guard against matcher being NULL when matching

This commit is contained in:
Laria 2022-07-31 22:04:59 +02:00
parent 41d0ee6132
commit d731fa828a

View file

@ -712,6 +712,10 @@ matcher_init_matching_inner(apfl_ctx ctx, struct matcher *matcher)
struct apfl_value value = apfl_stack_must_get(ctx, -1);
must_tmproot_add_value(ctx, value);
if (matcher == NULL) {
apfl_raise_const_error(ctx, APFL_RESULT_ERR, apfl_messages.corrupted_bytecode);
}
struct matcher_call_stack_entry matcher_cse = {
.pc = 0,
.matcher = matcher,