aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index da82e0ea8b..8bef0bcdd4 100644
--- a/eval.c
+++ b/eval.c
@@ -4686,6 +4686,10 @@ rb_yield_0(val, self, klass, flags, avalue)
POP_TAG();
if (state) goto pop_state;
}
+ else if (lambda && RARRAY(val)->len != 0) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)",
+ RARRAY(val)->len);
+ }
if (!node) {
state = 0;
goto pop_state;