Ticket #1662: rest_args.patch

File rest_args.patch, 1.4 KB (added by sjamaan, 2 years ago)
  • chicken.h

    diff --git a/chicken.h b/chicken.h
    index a46c2428..de3d8bfe 100644
    a b typedef void (C_ccall *C_proc)(C_word, C_word *) C_noret; 
    12461246#define C_do_apply(c, av)               ((C_proc)(void *)C_block_item((av)[0], 0))((c), (av))
    12471247#define C_kontinue(k, r)                do { C_word avk[ 2 ]; avk[ 0 ] = (k); avk[ 1 ] = (r); ((C_proc)(void *)C_block_item((k),0))(2, avk); } while(0)
    12481248#define C_get_rest_arg(c, n, av, ka, cl)((n) >= (c) ? (C_rest_arg_out_of_bounds_error_2(C_fix(c), C_fix(n), C_fix(ka), (cl)), C_SCHEME_UNDEFINED) : (av)[(n)])
     1249#define C_rest_arg_out_of_bounds_error_value(c, n, ka) (C_rest_arg_out_of_bounds_error((c),(n),(ka)), C_SCHEME_UNDEFINED)
    12491250#define C_rest_nullp(c, n)              (C_mk_bool((n) >= (c)))
    12501251#define C_fetch_byte(x, p)              (((unsigned C_byte *)C_data_pointer(x))[ p ])
    12511252#define C_poke_integer(x, i, n)         (C_set_block_item(x, C_unfix(i), C_num_to_int(n)), C_SCHEME_UNDEFINED)
  • support.scm

    diff --git a/support.scm b/support.scm
    index 48f3970d..c9f03e8e 100644
    a b  
    760760               (if (> len depth)
    761761                   (copy-node! (varnode (list-ref rest-args depth)) n)
    762762                   (copy-node! (make-node '##core#inline
    763                                           (list "C_rest_arg_out_of_bounds_error")
     763                                          (list "C_rest_arg_out_of_bounds_error_value")
    764764                                          (list (qnode len) (qnode depth) (qnode 0)))
    765765                               n)))
    766766             n))