From: Mark Wielaard Date: Tue, 28 May 2019 15:20:31 +0000 (+0200) Subject: Fix coding nit in x86amd64g_calculate_FXTRACT. X-Git-Tag: VALGRIND_3_16_0~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82b92e2ebfdd84ac953b05f679c67834942062b;p=thirdparty%2Fvalgrind.git 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. --- 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)