aboutsummaryrefslogtreecommitdiffstats
path: root/insnhelper.ci
diff options
context:
space:
mode:
Diffstat (limited to 'insnhelper.ci')
-rw-r--r--insnhelper.ci5
1 files changed, 3 insertions, 2 deletions
diff --git a/insnhelper.ci b/insnhelper.ci
index 92e88e9632..73ea6ee09a 100644
--- a/insnhelper.ci
+++ b/insnhelper.ci
@@ -196,12 +196,13 @@ caller_setup_args(rb_thread_t *th, rb_control_frame_t *cfp, VALUE flag,
if (proc != Qnil) {
if (!rb_obj_is_proc(proc)) {
- proc = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
- if (!rb_obj_is_proc(proc)) {
+ VALUE b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
+ if (NIL_P(b)) {
rb_raise(rb_eTypeError,
"wrong argument type %s (expected Proc)",
rb_obj_classname(proc));
}
+ proc = b;
}
GetProcPtr(proc, po);
blockptr = &po->block;