Should not call initialize_copy for TT_ICLASS; fix #4027

Since `TT_ICLASS` is a internal object that should never be revealed
to Ruby world.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-05-30 17:05:40 +09:00
parent 1dddc2f712
commit b64ce17852
+3
View File
@@ -279,6 +279,9 @@ static void
init_copy(mrb_state *mrb, mrb_value dest, mrb_value obj)
{
switch (mrb_type(obj)) {
case MRB_TT_ICLASS:
copy_class(mrb, dest, obj);
return;
case MRB_TT_CLASS:
case MRB_TT_MODULE:
copy_class(mrb, dest, obj);