diff --git a/src/eval.c b/src/eval.c index 57742c0..0c410ef 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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,