summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-28 08:42:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-28 08:42:40 +0000
commitc9cf552a91f7248b73e2e7cab5b423861176a95c (patch)
tree8dc3e9ac704d3f5789f5547d0de557712d390b36 /eval.c
parent5f12cd3e24538d79581e6572badcca1a6d3ae95e (diff)
* eval.c (is_defined): defined?(Foo::Baz) should check constants
only, no methods. * eval.c (is_defined): should not dump core on defined?(a::b) where a is not a class nor a module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 79bc1c6703..e6e5ab6753 100644
--- a/eval.c
+++ b/eval.c
@@ -1871,8 +1871,9 @@ is_defined(self, node, buf)
case T_MODULE:
if (rb_const_defined_at(val, node->nd_mid))
return "constant";
+ break;
default:
- if (rb_method_boundp(val, node->nd_mid, 1)) {
+ if (rb_method_boundp(CLASS_OF(val), node->nd_mid, 1)) {
return "method";
}
}
@@ -6783,6 +6784,7 @@ umethod_bind(method, recv)
method = Data_Make_Struct(rb_cMethod,struct METHOD,bm_mark,free,bound);
*bound = *data;
bound->recv = recv;
+ bound->rklass = CLASS_OF(recv);
return method;
}