From 89b8879c275ee551565c1bb7ae26ac9803dae8d1 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 5 Sep 2015 17:17:55 +0200 Subject: [PATCH] Replace two more memcpy calls with memmove. (apply apply ...) may result in memcpy of temporary stack into temporary stack. This is triggered by syntax-tests.scm on OpenBSD when compiled with clang (thanks to Alex Shendi for reporting this) --- runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime.c b/runtime.c index 873b553..ad62e4f 100644 --- a/runtime.c +++ b/runtime.c @@ -5972,7 +5972,7 @@ void C_ccall C_apply(C_word c, C_word *av) *(ptr++) = k; if(n > 1) { - C_memcpy(ptr, av + 3, m * sizeof(C_word)); + C_memmove(ptr, av + 3, m * sizeof(C_word)); ptr += m; } @@ -7805,7 +7805,7 @@ void C_ccall C_make_structure(C_word c, C_word *av) { if(!C_demand(c - 1)) { C_temporary_stack = C_temporary_stack_bottom - (c - 1); - C_memcpy(C_temporary_stack, av + 1, (c - 1) * sizeof(C_word)); + C_memmove(C_temporary_stack, av + 1, (c - 1) * sizeof(C_word)); C_reclaim((void *)make_structure_2, c - 1); } -- 2.1.4