Author: leo
Date: Mon Jan 16 05:43:00 2006
New Revision: 11213
Modified:
trunk/src/inter_call.c
trunk/t/op/calling.t
Log:
fix empty get_params error checking
Modified: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c (original)
+++ trunk/src/inter_call.c Mon Jan 16 05:43:00 2006
@@ -675,6 +675,9 @@ parrot_pass_args(Interp *interpreter, p
Parrot_init_arg_op(interpreter, src_ctx, src_pc, &st.src);
st.opt_so_far = 0; /* XXX */
st.n_actual_args = st.src.n; /* initial guess, adjusted for :flat args */
+ if (!todo) {
+ st.dest.sig = 0;
+ }
while (todo) {
Parrot_fetch_arg(interpreter, &st);
Parrot_convert_arg(interpreter, &st);
Modified: trunk/t/op/calling.t
==============================================================================
--- trunk/t/op/calling.t (original)
+++ trunk/t/op/calling.t Mon Jan 16 05:43:00 2006
@@ -469,7 +469,7 @@ CODE
/too few arguments passed/
OUTPUT
-pir_output_like(<<'CODE', <<'OUTPUT', "argc mismatch, too few", todo => 'no
get_params at all');
+pir_output_like(<<'CODE', <<'OUTPUT', "argc mismatch, too many - no
getparams", todo => 'no get_params at all');
.sub main :main
.include "errors.pasm"
errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
@@ -479,7 +479,24 @@ pir_output_like(<<'CODE', <<'OUTPUT', "a
print "nada"
.end
CODE
-/too few arguments passed/
+/too many arguments passed/
+OUTPUT
+
+pir_output_like(<<'CODE', <<'OUTPUT', "argc mismatch, too mayn - force
get_params");
+.macro no_params
+ get_params '()'
+.endm
+.sub main :main
+ .include "errors.pasm"
+ errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
+ foo(5)
+.end
+.sub foo
+ .no_params
+ print "nada"
+.end
+CODE
+/too many arguments passed/
OUTPUT
pir_output_like(<<'CODE', <<'OUTPUT', "argc mismatch, too many");
@@ -1586,5 +1603,5 @@ OUTPUT
## remember to change the number of tests :-)
-BEGIN { plan tests => 58; }
+BEGIN { plan tests => 59; }