summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-25 04:04:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-25 04:04:48 +0000
commit66a97945e30119503b43d0d2b8dde62c961c3c17 (patch)
treed18b20c50bb071a6c71b21ac457f54935edd5435 /proc.c
parent8be423f51d56f92cf8a16fab02bcfebda5c409c0 (diff)
* proc.c (mnew): fix for instance method of Module, BasicObject
and subclass of a class which overrides respond_to_missing?. based on a patch from Nikolai Lugovoi <nlugovoi AT gmail.com> in [ruby-core:25748]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index ac6689d77d..c6333b067b 100644
--- a/proc.c
+++ b/proc.c
@@ -912,7 +912,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
ID rmiss = rb_intern("respond_to_missing?");
VALUE sym = ID2SYM(id);
- if (!rb_method_basic_definition_p(klass, rmiss)) {
+ if (obj != Qundef && !rb_method_basic_definition_p(klass, rmiss)) {
if (RTEST(rb_funcall(obj, rmiss, 1, sym))) {
return rb_proc_new(missing_wrap, rb_assoc_new(obj, sym));
}