vm.c (catch_handler_find): check if irep is NULL; fix #6052

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-09-19 12:56:42 +09:00
parent 75e8a72649
commit ec3baece4f
+1 -1
View File
@@ -1111,7 +1111,7 @@ catch_handler_find(mrb_state *mrb, mrb_callinfo *ci, const mrb_code *pc, uint32_
if (ci->proc == NULL || MRB_PROC_CFUNC_P(ci->proc)) return NULL;
irep = ci->proc->body.irep;
if (irep->clen < 1) return NULL;
if (irep == NULL || irep->clen < 1) return NULL;
xpc = pc - irep->iseq;
/* If it retry at the top level, pc will be 0, so check with -1 as the start position */
mrb_assert(catch_cover_p(xpc, -1, irep->ilen));