summaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 8d1054c8a..18cc8361d 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -255,10 +255,9 @@ check_funcall_exec(struct rescue_funcall_args *args)
static VALUE
check_funcall_failed(struct rescue_funcall_args *args, VALUE e)
{
- VALUE sym = rb_funcall(e, rb_intern("name"), 0, 0);
-
- if (args->sym != sym)
+ if (rb_respond_to(args->recv, args->sym)) {
rb_exc_raise(e);
+ }
return Qundef;
}