summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-28 13:34:14 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-28 13:34:14 +0900
commit220f3124b9bd7a993e78b5832d0501209236487f (patch)
tree28ff349094cb6bfc987c402b8e3960f7af347f7a /src
parentb1ec92f7cd3a86f88a2e82a7dbf0ad0b1ab1c5c1 (diff)
downloadmruby-220f3124b9bd7a993e78b5832d0501209236487f.tar.gz
mruby-220f3124b9bd7a993e78b5832d0501209236487f.zip
should care about the case that given arguments are less then mandatory formal arguments and optional arguments exist; close #2144
Diffstat (limited to 'src')
-rw-r--r--src/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index df8fe934b..b175ef42f 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1303,7 +1303,7 @@ RETRY_TRY_BLOCK:
if (r) {
regs[m1+o+1] = mrb_ary_new_capa(mrb, 0);
}
- if (o == 0) pc++;
+ if (o == 0 || argc < m1+m2) pc++;
else
pc += argc - m1 - m2 + 1;
}