summaryrefslogtreecommitdiffhomepage
path: root/src/kernel.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-05-30 17:05:40 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-05-30 17:05:40 +0900
commitb64ce17852b180dfeea81cf458660be41a78974d (patch)
treeb82d8690161f8404bb840086dc63b57b49c3b45e /src/kernel.c
parent1dddc2f712f774b22a8f65432299cebb3b26361b (diff)
downloadmruby-b64ce17852b180dfeea81cf458660be41a78974d.tar.gz
mruby-b64ce17852b180dfeea81cf458660be41a78974d.zip
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.
Diffstat (limited to 'src/kernel.c')
-rw-r--r--src/kernel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/kernel.c b/src/kernel.c
index 8551b50ea..2a50d3126 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -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);