summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-05 12:36:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-05 12:36:45 +0000
commitf113ab552c7f83bd12f4136bce7fb8ee89819adb (patch)
treec093b2d22bd3fec33646b12aea019edc820e1ea3 /class.c
parent00a8203b0b31ba2063f4344418331af2dbed7db3 (diff)
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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/class.c b/class.c
index c1903f9076..b8e47df8f2 100644
--- a/class.c
+++ b/class.c
@@ -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);
+ }
}
/*