From a82b92e2ebfdd84ac953b05f679c67834942062b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 28 May 2019 17:20:31 +0200 Subject: [PATCH] Fix coding nit in x86amd64g_calculate_FXTRACT. The current code "return getExp ? posInf : posInf;" looks like a typo. But when the argument is positive infinity then both the significand and the exponent are positive infinity (there is a fxtract testcase that checks that). So no need to check getExp. Just always return posInf if arg == posInf, but add a comment explaining why. --- VEX/priv/guest_generic_x87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VEX/priv/guest_generic_x87.c b/VEX/priv/guest_generic_x87.c index 1e76395d52..85ebebdc77 100644 --- a/VEX/priv/guest_generic_x87.c +++ b/VEX/priv/guest_generic_x87.c @@ -453,7 +453,7 @@ ULong x86amd64g_calculate_FXTRACT ( ULong arg, HWord getExp ) /* Mimic Core i5 behaviour for special cases. */ if (arg == posInf) - return getExp ? posInf : posInf; + return posInf; /* Both significand and exponent are posInf. */ if (arg == negInf) return getExp ? posInf : negInf; if ((arg & nanMask) == nanMask) -- 2.47.2