The `clone` method should copy object status (e.g. frozen) too;
MODIFY
src/kernel.c
src/kernel.c
@@ -348,6 +348,7 @@ mrb_obj_clone(mrb_state *mrb, mrb_value self)
mrb_field_write_barrier(mrb, (struct RBasic*)p, (struct RBasic*)p->c);
clone = mrb_obj_value(p);
init_copy(mrb, clone, self);
+ p->flags = mrb_obj_ptr(self)->flags;
return clone;
}

MODIFY
test/t/kernel.rb
test/t/kernel.rb
@@ -171,6 +171,10 @@ assert('Kernel#clone', '15.3.1.3.8') do
assert_true a.respond_to?(:test)
assert_false b.respond_to?(:test)
assert_true c.respond_to?(:test)
+
+ a.freeze
+ d = a.clone
+ assert_true d.frozen?
end
assert('Kernel#dup', '15.3.1.3.9') do

The `clone` method should copy object status (e.g. frozen) too; #4030