From 0b933f1f4839e5e1a2dd2125547b5ecdf2b91e0f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 22 Jul 2016 11:49:37 +0900 Subject: [PATCH] server: Avoid unaligned access when printing x86 floating point registers. Signed-off-by: Alexandre Julliard --- server/trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/trace.c b/server/trace.c index d48c2050689..9286ebd3f2e 100644 --- a/server/trace.c +++ b/server/trace.c @@ -567,7 +567,11 @@ static void dump_varargs_context( const char *prefix, data_size_t size ) fprintf( stderr, ",fp.data_off=%08x,fp.data_sel=%08x,fp.cr0npx=%08x", ctx.fp.i386_regs.data_off, ctx.fp.i386_regs.data_sel, ctx.fp.i386_regs.cr0npx ); for (i = 0; i < 8; i++) - fprintf( stderr, ",fp.reg%u=%Lg", i, *(long double *)&ctx.fp.i386_regs.regs[10*i] ); + { + long double reg = 0; + memcpy( ®, &ctx.fp.i386_regs.regs[10 * i], 10 ); + fprintf( stderr, ",fp.reg%u=%Lg", i, reg ); + } } if (ctx.flags & SERVER_CTX_EXTENDED_REGISTERS) {