From d298da8e72d930ed63d2d68c1c21b12d36e1348d Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 28 Sep 2023 11:37:07 +0900 Subject: [PATCH] vm.c (eval_under): check if irep is NULL; fix #6065 --- src/vm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vm.c b/src/vm.c index 47457b129..e704f9a9d 100644 --- a/src/vm.c +++ b/src/vm.c @@ -898,6 +898,8 @@ eval_under(mrb_state *mrb, mrb_value self, mrb_value blk, struct RClass *c) } ci->u.target_class = c; p = mrb_proc_ptr(blk); + /* just in case irep is NULL; #6065 */ + if (p->body.irep == NULL) return mrb_nil_value(); CI_PROC_SET(ci, p); ci->n = 1; ci->nk = 0;