mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/string: correct memmove()'s forwarding to memcpy()
With memcpy() expanding to the compiler builtin, we may not hand it overlapping source and destination. We strictly mean to forward to our own implementation (a few lines up in the same source file). Fixes:78825e1c60("x86/string: Clean up x86/string.h") Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> master commit:7b93d92a35master date: 2021-02-04 13:59:56 +0100
This commit is contained in:
1 parent
e9cb958823
commit
2c813771c5
1 file changed
+2
-1
@@ -43,7 +43,8 @@ void *(memmove)(void *dest, const void *src, size_t n)
|
||||
return dest;
|
||||
|
||||
if ( dest < src )
|
||||
return memcpy(dest, src, n);
|
||||
/* Depends on Xen's implementation operating forwards. */
|
||||
return (memcpy)(dest, src, n);
|
||||
|
||||
asm volatile (
|
||||
" std ; "
|
||||
|
||||