From 1a9991f16575b922746e6e656d7e05e5812bbda9 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 2 Mar 2022 15:49:01 +0900 Subject: [PATCH] string.c: remove unnecessary size check before string initialization. --- src/string.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/string.c b/src/string.c index d5a914776..d49494bbb 100644 --- a/src/string.c +++ b/src/string.c @@ -111,9 +111,6 @@ str_new_static(mrb_state *mrb, const char *p, mrb_int len) if (RSTR_EMBEDDABLE_P(len)) { return str_init_embed(mrb_obj_alloc_string(mrb), p, len); } - if (len >= MRB_SSIZE_MAX) { - mrb_raise(mrb, E_ARGUMENT_ERROR, "string size too big"); - } return str_init_nofree(mrb_obj_alloc_string(mrb), p, len); } @@ -123,9 +120,6 @@ str_new(mrb_state *mrb, const char *p, mrb_int len) if (RSTR_EMBEDDABLE_P(len)) { return str_init_embed(mrb_obj_alloc_string(mrb), p, len); } - if (len >= MRB_SSIZE_MAX) { - mrb_raise(mrb, E_ARGUMENT_ERROR, "string size too big"); - } if (p && mrb_ro_data_p(p)) { return str_init_nofree(mrb_obj_alloc_string(mrb), p, len); }