From cead78b3943c62447a2fbfc892bdfdefd5ee9a79 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 17 May 2023 09:52:00 +0900 Subject: [PATCH] variable.c (iv_rehash): fixed removed check This check removed in 70cc2cc was necessary. --- src/variable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/variable.c b/src/variable.c index 8afb36cca..a11a23bec 100644 --- a/src/variable.c +++ b/src/variable.c @@ -51,6 +51,7 @@ iv_rehash(mrb_state *mrb, iv_tbl *t) t->ptr = (mrb_value*)mrb_calloc(mrb, sizeof(mrb_value)+sizeof(mrb_sym), new_alloc); t->size = 0; t->alloc = new_alloc; + if (old_alloc == 0) return; mrb_sym *keys = (mrb_sym*)&old_ptr[old_alloc]; mrb_value *vals = old_ptr;