Index: src/inter_call.c =================================================================== --- src/inter_call.c (revision 11276) +++ src/inter_call.c (working copy) @@ -728,6 +728,7 @@ enum_class_ResizablePMCArray)); CTX_REG_PMC(st->dest.ctx, idx) = st->dest.slurp; st->dest.mode |= CALL_STATE_SLURP; + st->dest.mode &= ~CALL_STATE_OPT; } static void @@ -916,8 +917,9 @@ break; default: - internal_exception(1, "Unhandled process_args state 0x%x", - state); + real_exception(interpreter, NULL, 0, + "Unhandled process_args state 0x%x", + state); } } while (1); } Index: t/op/calling.t =================================================================== --- t/op/calling.t (revision 11276) +++ t/op/calling.t (working copy) @@ -1714,6 +1714,38 @@ ok OUTPUT +pir_output_is(<<'CODE', <<'OUTPUT', ":optional followed by :slurpy (empty)"); +.sub main :main + _write_thing(3) +.end +.sub _write_thing + .param pmc arg1 :optional + .param pmc rest_arg :slurpy + print arg1 + print ' ' + print rest_arg + print "\n" +.end +CODE +3 0 +OUTPUT + +pir_output_is(<<'CODE', <<'OUTPUT', ":optional followed by :slurpy (used)"); +.sub main :main + _write_thing(3, 4, 5) +.end +.sub _write_thing + .param pmc arg1 :optional + .param pmc rest_arg :slurpy + print arg1 + print ' ' + print rest_arg + print "\n" +.end +CODE +3 2 +OUTPUT + ## remember to change the number of tests :-) -BEGIN { plan tests => 64; } +BEGIN { plan tests => 66; }