mruby-data (mrb_data_init_copy): use data_corrupted() for errors

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-07 07:49:19 +09:00
parent 38098ddf2a
commit 672495555b
+1 -1
View File
@@ -270,7 +270,7 @@ mrb_data_init_copy(mrb_state *mrb, mrb_value copy)
mrb_raise(mrb, E_TYPE_ERROR, "wrong argument class");
}
if (!data_p(s)) {
mrb_raise(mrb, E_TYPE_ERROR, "corrupted Data");
data_corrupted(mrb);
}
mrb_ary_replace(mrb, copy, s);
mrb_obj_freeze(mrb, copy);