|
From: Mark W. <ma...@so...> - 2021-02-12 19:47:29
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e2e830f61271c28dddfa6b478044870d2188cf57 commit e2e830f61271c28dddfa6b478044870d2188cf57 Author: Mark Wielaard <ma...@kl...> Date: Fri Feb 12 20:42:00 2021 +0100 PR432809 VEX should support REX.W + POPF It seems a REX.W prefix simply explicitly sets the operant size to 8, and so can/must be ignored as redundant. This is what we already do for PUSH, POP and PUSHF. All instructions are described as "When in 64-bit mode, instruction defaults to 64-bit operand size and cannot encode 32-bit operand size." in the instruction manual. Original patch and analysis by Mike Dalessio <mik...@gm...> https://bugs.kde.org/show_bug.cgi?id=432809 Diff: --- NEWS | 1 + VEX/priv/guest_amd64_toIR.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index dbe029ecea..eafe0cb009 100644 --- a/NEWS +++ b/NEWS @@ -88,6 +88,7 @@ n-i-bz helgrind: If hg_cli__realloc fails, return NULL. 430354 ppc stxsibx and stxsihx instructions write too much data 430485 expr_is_guardable doesn't handle Iex_Qop 432672 vg_regtest: test-specific environment variables not reset between tests +432809 VEX should support REX.W + POPF 432861 PPC modsw and modsd give incorrect results for 1 mod 12 Release 3.16.1 (?? June 2020) diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index 2faca7d03f..30487065d7 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -20586,7 +20586,7 @@ Long dis_ESC_NONE ( /* Note. There is no encoding for a 32-bit popf in 64-bit mode. So sz==4 actually means sz==8. */ if (haveF2orF3(pfx)) goto decode_failure; - vassert(sz == 2 || sz == 4); + vassert(sz == 2 || sz == 4 || sz == 8); if (sz == 4) sz = 8; if (sz != 8) goto decode_failure; // until we know a sz==2 test case exists t1 = newTemp(Ity_I64); t2 = newTemp(Ity_I64); |