diff options
author | Jeremy Evans <[email protected]> | 2020-06-01 15:54:47 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2020-06-18 08:22:40 -0700 |
commit | b6d6b896159390014020caac69fa465029af5460 (patch) | |
tree | 174526655d9b2e690822e4ba1c925c158a0e1202 /vm_method.c | |
parent | 95dc9c07f3a895f45cfb5dab235cd78f157a9e51 (diff) |
Allow refining a frozen class
Doing so modifies the class's method table, but not in a way that should
be detectable from Ruby, so it may be safe to avoid checking if the
class is frozen.
Fixes [Bug #11669]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3175
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c index f1b71a181c..2b2e28e10c 100644 --- a/vm_method.c +++ b/vm_method.c @@ -714,7 +714,9 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil } } - rb_class_modify_check(klass); + if (type != VM_METHOD_TYPE_REFINED) { + rb_class_modify_check(klass); + } if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) { VALUE refined_class = rb_refinement_module_get_refined_class(klass); |