summaryrefslogtreecommitdiffstats
path: root/vm_method.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-28 12:08:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-28 12:08:19 +0000
commit7d2afd6bf819f9058cfb9a43eec32121af43f487 (patch)
treeeb3db3f20f81ef5244be2f77fdf6246400b702c1 /vm_method.c
parent1ab1ff54e6abb6ae964d6b3965a795758277e63a (diff)
downloadruby-7d2afd6bf819f9058cfb9a43eec32121af43f487.tar.gz
ruby-7d2afd6bf819f9058cfb9a43eec32121af43f487.tar.xz
ruby-7d2afd6bf819f9058cfb9a43eec32121af43f487.zip
* vm_method.c (rb_method_node): fail earlier if no method found.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_method.c b/vm_method.c
index 0254741b8..b0f69afd0 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -292,8 +292,9 @@ rb_method_node(VALUE klass, ID id)
struct cache_entry *ent;
ent = cache + EXPR1(klass, id);
- if (ent->mid == id && ent->klass == klass && ent->method) {
- return ent->method;
+ if (ent->mid == id && ent->klass == klass) {
+ if (ent->method) return ent->method;
+ return 0;
}
return rb_get_method_body(klass, id, 0);