summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-24 02:38:43 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-24 02:38:43 (GMT)
commit0cd34e96396c0e552f323b2c908419cf158830ca (patch)
treeee7056b9bdf4cfc1a3019a2e497aa7779a7b5db1 /vm_method.c
parent53ec85b5b4de333f564fe50dae970a4983daaa64 (diff)
vm_method.c: for hidden object
* vm_method.c (rb_method_basic_definition_p): methods of hidden objects cannot be overridden, return TRUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c
index 66c783c..e3c365d 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1859,7 +1859,9 @@ rb_mod_modfunc(int argc, VALUE *argv, VALUE module)
int
rb_method_basic_definition_p(VALUE klass, ID id)
{
- const rb_method_entry_t *me = rb_method_entry(klass, id);
+ const rb_method_entry_t *me;
+ if (!klass) return TRUE; /* hidden object cannot be overridden */
+ me = rb_method_entry(klass, id);
return (me && METHOD_ENTRY_BASIC(me)) ? TRUE : FALSE;
}