~ chicken-core (chicken-5) e03847a03d47415a9ded94ef66a3bcb690aadf73
commit e03847a03d47415a9ded94ef66a3bcb690aadf73
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Jun 20 15:40:49 2011 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Mon Jun 20 15:41:57 2011 +0200
immediate non-null argument to list-tail resulted in crashing type-check (reported by Sven Hartrumpf)
diff --git a/runtime.c b/runtime.c
index d439aa59..2e01b06c 100644
--- a/runtime.c
+++ b/runtime.c
@@ -4834,7 +4834,8 @@ C_regparm C_word C_fcall C_i_list_tail(C_word lst, C_word i)
C_word lst0 = lst;
int n;
- if(lst != C_SCHEME_END_OF_LIST && C_block_header(lst) != C_PAIR_TAG)
+ if(lst != C_SCHEME_END_OF_LIST &&
+ (C_immediatep(lst) || C_block_header(lst) != C_PAIR_TAG))
barf(C_BAD_ARGUMENT_TYPE_ERROR, "list-tail", lst);
if(i & C_FIXNUM_BIT) n = C_unfix(i);
Trap