~ chicken-core (chicken-5) 69ca5e082d8781f21c41ac774b31848db9323aae
commit 69ca5e082d8781f21c41ac774b31848db9323aae Author: Peter Bex <peter@more-magic.net> AuthorDate: Sat Aug 22 18:14:06 2015 +0200 Commit: Peter Bex <peter@more-magic.net> CommitDate: Sat Aug 22 19:37:26 2015 +0200 several corrections in C_apply_values diff --git a/runtime.c b/runtime.c index 0c57b4b5..ebccddc7 100644 --- a/runtime.c +++ b/runtime.c @@ -7296,19 +7296,29 @@ void C_ccall C_apply_values(C_word c, C_word *av) av2 = C_alloc(n + 1); av2[ 0 ] = k; C_memcpy(av2 + 1, C_temporary_stack_limit, n * sizeof(C_word)); - C_do_apply(n, av2); + C_do_apply(n + 1, av2); } - if(C_immediatep(lst) || (C_block_header(lst) == C_PAIR_TAG && C_u_i_cdr(lst) == C_SCHEME_END_OF_LIST)) { + if(C_immediatep(lst)) { #ifdef RELAX_MULTIVAL_CHECK - if(C_immediatep(lst)) n = C_SCHEME_UNDEFINED; - else n = C_u_i_car(lst); + n = C_SCHEME_UNDEFINED; #else barf(C_CONTINUATION_CANT_RECEIVE_VALUES_ERROR, "values", k); #endif } - else n = C_u_i_car(lst); - + else if(C_block_header(lst) == C_PAIR_TAG) { + if(C_u_i_cdr(lst) == C_SCHEME_END_OF_LIST) + n = C_u_i_car(lst); + else { +#ifdef RELAX_MULTIVAL_CHECK + n = C_u_i_car(lst); +#else + barf(C_CONTINUATION_CANT_RECEIVE_VALUES_ERROR, "values", k); +#endif + } + } + else barf(C_BAD_ARGUMENT_TYPE_ERROR, "apply", lst); + C_kontinue(k, n); }Trap