ntdll: Use memcpy() in set_float_reg().

The source address might not be aligned although the compiler can
expect alignment when using a plain assignment.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2020-05-22 20:39:59 +02:00 committed by Alexandre Julliard
parent 2716e215df
commit 2e5c2c7cdb
1 changed files with 2 additions and 1 deletions

View File

@ -3298,7 +3298,8 @@ static void set_int_reg( CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *ctx_pt
static void set_float_reg( CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *ctx_ptr, int reg, M128A *val )
{
*(&context->u.s.Xmm0 + reg) = *val;
/* Use a memcpy() to avoid issues if val is misaligned. */
memcpy(&context->u.s.Xmm0 + reg, val, sizeof(*val));
if (ctx_ptr) ctx_ptr->u.FloatingContext[reg] = val;
}