diff options
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1844,6 +1844,11 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, rb_iseq_t *miseq; GetISeqPtr(iseqval, miseq); + if (miseq->klass) { + iseqval = rb_iseq_clone(iseqval, 0); + GetISeqPtr(iseqval, miseq); + } + if (NIL_P(klass)) { rb_raise(rb_eTypeError, "no class/module to add method"); } |