From: Keir Fraser Date: Tue, 4 Dec 2007 11:23:05 +0000 (+0000) Subject: x86_emulate: Fix SHLD/SHRD emulation -- cannot rely on dst.orig_val X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14681 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5bef17da44e8e95e7037034b1f9bddb211a6f764;p=xen.git x86_emulate: Fix SHLD/SHRD emulation -- cannot rely on dst.orig_val being already initialised. From: Dexuan Cui Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index f6b2215cfd..20f6cec5b5 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -2624,7 +2624,7 @@ x86_emulate( shift = (b & 1) ? (uint8_t)_regs.ecx : insn_fetch_type(uint8_t); if ( (shift &= width - 1) == 0 ) break; - dst.orig_val = truncate_word(dst.orig_val, dst.bytes); + dst.orig_val = truncate_word(dst.val, dst.bytes); dst.val = ((shift == width) ? src.val : (b & 8) ? /* shrd */