summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 08:32:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 08:32:53 +0000
commite0889dbf3882f006b5cef6680afd43e817a1a63e (patch)
tree8847d86c96b64e1e073c31680e902cf1a6b7e2b5 /vm_insnhelper.c
parent5068e137d059a67878fbc8618a0a3cf9bd616ad6 (diff)
* vm_insnhelper.c (caller_setup_args): should ensure if the value
from to_proc is a real Proc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 0fe9902418..a5967f736c 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -221,7 +221,7 @@ caller_setup_args(const rb_thread_t *th, rb_control_frame_t *cfp, VALUE flag,
if (proc != Qnil) {
if (!rb_obj_is_proc(proc)) {
VALUE b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
- if (NIL_P(b)) {
+ if (NIL_P(b) || !rb_obj_is_proc(b)) {
rb_raise(rb_eTypeError,
"wrong argument type %s (expected Proc)",
rb_obj_classname(proc));