should care about the case that given arguments are less then mandatory formal argume...
authorYukihiro "Matz" Matsumoto <[email protected]>
Mon, 28 Apr 2014 04:34:14 +0000 (28 13:34 +0900)
committerYukihiro "Matz" Matsumoto <[email protected]>
Mon, 28 Apr 2014 04:34:14 +0000 (28 13:34 +0900)
src/vm.c

index df8fe93..b175ef4 100644 (file)
--- 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;
       }