Commit 2e5c2c7c authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

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: 's avatarMatteo Bruni <mbruni@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2716e215
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment