Piotr Caban : msvcrt: Fix math error arguments in powf.

Alexandre Julliard julliard at winehq.org
Mon Jun 14 16:00:36 CDT 2021


Module: wine
Branch: master
Commit: 9d2de96d075937ba0d3767fe147c4dc6baae6433
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9d2de96d075937ba0d3767fe147c4dc6baae6433

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Jun 14 17:40:28 2021 +0200

msvcrt: Fix math error arguments in powf.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/math.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 3d4ce3b3108..f09330d57a1 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -1567,7 +1567,7 @@ float CDECL powf( float x, float y )
             if (ix & 0x80000000 && powf_checkint(iy) == 1)
                 x2 = -x2;
             if (iy & 0x80000000 && x2 == 0.0)
-                return math_error(_SING, "powf", x, 0, 1 / x2);
+                return math_error(_SING, "powf", x, y, 1 / x2);
             /* Without the barrier some versions of clang hoist the 1/x2 and
                thus division by zero exception can be signaled spuriously. */
             return iy & 0x80000000 ? fp_barrierf(1 / x2) : x2;
@@ -1577,7 +1577,7 @@ float CDECL powf( float x, float y )
             /* Finite x < 0. */
             int yint = powf_checkint(iy);
             if (yint == 0)
-                return math_error(_DOMAIN, "powf", x, 0, 0 / (x - x));
+                return math_error(_DOMAIN, "powf", x, y, 0 / (x - x));
             if (yint == 1)
                 sign_bias = 1 << (5 + 11);
             ix &= 0x7fffffff;
@@ -1595,9 +1595,9 @@ float CDECL powf( float x, float y )
     if ((*(UINT64*)&ylogx >> 47 & 0xffff) >= 0x40af800000000000llu >> 47) {
         /* |y*log(x)| >= 126. */
         if (ylogx > 0x1.fffffffd1d571p+6 * (1 << 5))
-            return math_error(_OVERFLOW, "powf", x, 0, (sign_bias ? -1.0 : 1.0) * 0x1p1023);
+            return math_error(_OVERFLOW, "powf", x, y, (sign_bias ? -1.0 : 1.0) * 0x1p1023);
         if (ylogx <= -150.0 * (1 << 5))
-            return math_error(_UNDERFLOW, "powf", x, 0, (sign_bias ? -1.0 : 1.0) / 0x1p1023);
+            return math_error(_UNDERFLOW, "powf", x, y, (sign_bias ? -1.0 : 1.0) / 0x1p1023);
     }
     return powf_exp2(ylogx, sign_bias);
 }




More information about the wine-cvs mailing list