Use mrb_int_value() instead of mrb_fixnum_value(); fix #5142

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-11-18 18:37:20 +09:00
parent b9c80a5357
commit e7d0baaf3b
+1 -1
View File
@@ -2378,7 +2378,7 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, mrb_int base, i
if (p<pend) goto bad; /* trailing garbage */
}
return mrb_fixnum_value(sign ? val : -val);
return mrb_int_value(mrb, sign ? val : -val);
nullbyte:
mrb_raise(mrb, E_ARGUMENT_ERROR, "string contains null byte");
/* not reached */