From b051549f2eb9466c81538f3d3d07b59e4e624bb7 Mon Sep 17 00:00:00 2001 From: Edmund Grimley Evans Date: Wed, 4 Nov 2015 20:23:17 +0000 Subject: [PATCH] tccgen.c: Use memmove for struct assignment: dest and src may be equal. --- tccgen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tccgen.c b/tccgen.c index b04c6b8..9405761 100644 --- a/tccgen.c +++ b/tccgen.c @@ -2576,7 +2576,8 @@ ST_FUNC void vstore(void) vpush_global_sym(&func_old_type, TOK_memcpy4); else #endif - vpush_global_sym(&func_old_type, TOK_memcpy); + /* Use memmove, rather than memcpy, as dest and src may be same: */ + vpush_global_sym(&func_old_type, TOK_memmove); vswap(); /* source */