From 664396a635fbf2b666c73615e97c9e1f5d85a9ae Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 15 May 2018 07:43:56 -0400 Subject: [PATCH] m68k: fix floatx80_mod() (Coverity CID1390568) Update the variable checked by the loop condition (expDiff). Backport the update from Previous. Fixes: 591596b77a ("target/m68k: add fmod/frem") Backports commit 5a73e7f313da0e4657bcac61b533ced71b0d0224 from qemu --- qemu/target/m68k/softfloat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu/target/m68k/softfloat.c b/qemu/target/m68k/softfloat.c index e41b07d0..d0939972 100644 --- a/qemu/target/m68k/softfloat.c +++ b/qemu/target/m68k/softfloat.c @@ -103,6 +103,7 @@ floatx80 floatx80_mod(floatx80 a, floatx80 b, float_status *status) mul64To128(bSig, qTemp, &term0, &term1); sub128(aSig0, aSig1, term0, term1, &aSig0, &aSig1); shortShift128Left(aSig0, aSig1, 62, &aSig0, &aSig1); + expDiff -= 62; } expDiff += 64; if (0 < expDiff) {