summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--insns.def11
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 18fa6b62d3..2616a46241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon May 31 02:17:54 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * insns.def (defined): respond_to_missing? may not be available
+ (for BasicObject instances).
+
Mon May 31 01:43:42 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/delegate: Delegator: combine (public|protected) methods with
diff --git a/insns.def b/insns.def
index 23c0143907..f75007dca2 100644
--- a/insns.def
+++ b/insns.def
@@ -799,8 +799,15 @@ defined
}
}
}
- if (RTEST(rb_funcall(v, rb_intern("respond_to_missing?"), 2, obj, Qfalse)))
- expr_type = "method";
+ {
+ VALUE args[2];
+ VALUE r;
+
+ args[0] = obj; args[1] = Qfalse;
+ r = rb_check_funcall(v, rb_intern("respond_to_missing?"), 2, args);
+ if (r != Qundef && RTEST(r))
+ expr_type = "method";
+ }
break;
}
case DEFINED_YIELD: