diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-05 12:36:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-05 12:36:45 +0000 |
commit | f113ab552c7f83bd12f4136bce7fb8ee89819adb (patch) | |
tree | c093b2d22bd3fec33646b12aea019edc820e1ea3 /class.c | |
parent | 00a8203b0b31ba2063f4344418331af2dbed7db3 (diff) | |
download | ruby-f113ab552c7f83bd12f4136bce7fb8ee89819adb.tar.gz |
class.c: check redefinition
* class.c (rb_prepend_module): check redefinition of built-in opimized
methods. [ruby-dev:47124] [Bug #7983]
* vm.c (rb_vm_check_redefinition_by_prepend): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -790,6 +790,7 @@ move_refined_method(st_data_t key, st_data_t value, st_data_t data) void rb_prepend_module(VALUE klass, VALUE module) { + void rb_vm_check_redefinition_by_prepend(VALUE klass); VALUE origin; int changed = 0; @@ -816,7 +817,10 @@ rb_prepend_module(VALUE klass, VALUE module) changed = include_modules_at(klass, klass, module); if (changed < 0) rb_raise(rb_eArgError, "cyclic prepend detected"); - if (changed) rb_clear_cache(); + if (changed) { + rb_clear_cache(); + rb_vm_check_redefinition_by_prepend(klass); + } } /* |