Merge pull request #4367 from shuujii/extract-frozen-checking-to-function

Extract frozen checking to function
This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-04-10 06:03:32 +09:00
committed by GitHub
8 changed files with 20 additions and 30 deletions
+1 -3
View File
@@ -346,9 +346,7 @@ mrb_obj_iv_set(mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v)
{
iv_tbl *t;
if (MRB_FROZEN_P(obj)) {
mrb_raisef(mrb, E_FROZEN_ERROR, "can't modify frozen %S", mrb_obj_value(obj));
}
mrb_check_frozen(mrb, obj);
assign_class_name(mrb, obj, sym, v);
if (!obj->iv) {
obj->iv = iv_new(mrb);