~ chicken-core (chicken-5) 1179da6629589a57487b6bd8028f871fa636a43f
commit 1179da6629589a57487b6bd8028f871fa636a43f
Author: Peter Bex <peter@more-magic.net>
AuthorDate: Fri Jan 17 11:30:31 2020 +0100
Commit: Evan Hanson <evhan@foldling.org>
CommitDate: Sun Jan 19 15:07:05 2020 +1300
Fix C codegen issue of assigning a call to void function
Instead of allowing the "result" of C_rest_arg_out_of_bounds_error to be
assigned to a variable, we add a macro that returns undefined to make
the C compiler happy.
Signed-off-by: Evan Hanson <evhan@foldling.org>
diff --git a/chicken.h b/chicken.h
index f56b6f48..376b0a26 100644
--- a/chicken.h
+++ b/chicken.h
@@ -1246,6 +1246,7 @@ typedef void (C_ccall *C_proc)(C_word, C_word *) C_noret;
#define C_do_apply(c, av) ((C_proc)(void *)C_block_item((av)[0], 0))((c), (av))
#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)
#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)])
+#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)
#define C_rest_nullp(c, n) (C_mk_bool((n) >= (c)))
#define C_fetch_byte(x, p) (((unsigned C_byte *)C_data_pointer(x))[ p ])
#define C_poke_integer(x, i, n) (C_set_block_item(x, C_unfix(i), C_num_to_int(n)), C_SCHEME_UNDEFINED)
diff --git a/support.scm b/support.scm
index a31789af..0027344f 100644
--- a/support.scm
+++ b/support.scm
@@ -760,7 +760,7 @@
(if (> len depth)
(copy-node! (varnode (list-ref rest-args depth)) n)
(copy-node! (make-node '##core#inline
- (list "C_rest_arg_out_of_bounds_error")
+ (list "C_rest_arg_out_of_bounds_error_value")
(list (qnode len) (qnode depth) (qnode 0)))
n)))
n))
Trap