|
From: Mark W. <ma...@so...> - 2019-05-28 16:12:18
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a82b92e2ebfdd84ac953b05f679c67834942062b commit a82b92e2ebfdd84ac953b05f679c67834942062b Author: Mark Wielaard <ma...@kl...> Date: Tue May 28 17:20:31 2019 +0200 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: --- 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 1e76395..85ebebd 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) |