should care about the case that given arguments are less then mandatory formal arguments and optional arguments exist; close #2144

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-28 13:34:14 +09:00
parent b1ec92f7cd
commit 220f3124b9
+1 -1
View File
@@ -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;
}