summaryrefslogtreecommitdiff
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
commitcf6334e1cb91bfee0f95e5ae7ea9c4a72df1f6c2 (patch)
treeeb3db3f20f81ef5244be2f77fdf6246400b702c1
parent84b144f6de2cb5eccb9b534217f3cf943896b613 (diff)
* vm_method.c (rb_method_node): fail earlier if no method found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog2
-rw-r--r--vm_method.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c028f81e6..7c8a8c8cdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@ Thu Aug 28 20:22:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* object.c (convert_type): call less rb_intern() less frequently
by using cache structure.
+ * vm_method.c (rb_method_node): fail earlier if no method found.
+
Thu Aug 28 19:04:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* bootstraptest/test_io.rb: no need to create real file.
diff --git a/vm_method.c b/vm_method.c
index 0254741b8a..b0f69afd04 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);