summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 22:02:03 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 22:02:03 +0000
commitbeb26e1b491f8d9fd20a2d944f036100cd1abac3 (patch)
tree55827b3594aa69f0c294e464598685630b161b78 /vm_method.c
parent72107daf0e9b35d28ae75c728134b64d2383cb65 (diff)
* vm_insnhelper.h, vm_insnhelper.c, vm.c, vm_method.c, insns.def:
Manage a redefinition of special methods for each classes. A patch from Joel Gouly <joel.gouly@gmail.com>. Thanks! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c
index 608760f2ad..d6c4926e65 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -6,7 +6,7 @@
#define CACHE_MASK 0x7ff
#define EXPR1(c,m) ((((c)>>3)^(m))&CACHE_MASK)
-static void rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me);
+static void rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me, VALUE klass);
static ID object_id, respond_to_missing;
static ID removed, singleton_removed, undefined, singleton_undefined;
@@ -195,7 +195,7 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type,
rb_method_definition_t *old_def = old_me->def;
if (rb_method_definition_eq(old_def, def)) return old_me;
- rb_vm_check_redefinition_opt_method(old_me);
+ rb_vm_check_redefinition_opt_method(old_me, klass);
if (RTEST(ruby_verbose) &&
type != VM_METHOD_TYPE_UNDEF &&
@@ -452,7 +452,7 @@ remove_method(VALUE klass, ID mid)
key = (st_data_t)mid;
st_delete(RCLASS_M_TBL(klass), &key, &data);
- rb_vm_check_redefinition_opt_method(me);
+ rb_vm_check_redefinition_opt_method(me, klass);
rb_clear_cache_for_undef(klass, mid);
rb_unlink_method_entry(me);
@@ -530,7 +530,7 @@ rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
}
if (me->flag != noex) {
- rb_vm_check_redefinition_opt_method(me);
+ rb_vm_check_redefinition_opt_method(me, klass);
if (klass == me->klass) {
me->flag = noex;