summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm_eval.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 78d0ae3447a..b765ad66920 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -483,9 +483,10 @@ rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
me = rb_search_method_entry(recv, mid);
if (!check_funcall_callable(th, me)) {
- (*hook)(FALSE, recv, mid, argc, argv, arg);
- return check_funcall_missing(th, klass, recv, mid, argc, argv,
- respond, Qundef);
+ VALUE ret = check_funcall_missing(th, klass, recv, mid, argc, argv,
+ respond, Qundef);
+ (*hook)(ret != Qundef, recv, mid, argc, argv, arg);
+ return ret;
}
stack_check();
(*hook)(TRUE, recv, mid, argc, argv, arg);