src/libm/e_rem_pio2.c
changeset 10650 b6ec7005ca15
parent 6044 35448a5ea044
child 11683 48bcba563d9c
     1.1 --- a/src/libm/e_rem_pio2.c	Thu Nov 24 21:13:23 2016 -0500
     1.2 +++ b/src/libm/e_rem_pio2.c	Thu Nov 24 21:41:09 2016 -0500
     1.3 @@ -24,6 +24,8 @@
     1.4  #include "math_libm.h"
     1.5  #include "math_private.h"
     1.6  
     1.7 +#include "SDL_assert.h"
     1.8 +
     1.9  libm_hidden_proto(fabs)
    1.10  
    1.11  /*
    1.12 @@ -189,7 +191,12 @@
    1.13      }
    1.14      tx[2] = z;
    1.15      nx = 3;
    1.16 -    while (tx[nx - 1] == zero)
    1.17 +
    1.18 +    /* If this assertion ever fires, here's the static analysis that warned about it:
    1.19 +        http://buildbot.libsdl.org/sdl-static-analysis/sdl-macosx-static-analysis/sdl-macosx-static-analysis-1101/report-8c6ccb.html#EndPath */
    1.20 +    SDL_assert((tx[0] != zero) || (tx[1] != zero) || (tx[2] != zero));
    1.21 +
    1.22 +    while (nx && tx[nx - 1] == zero)
    1.23          nx--;                   /* skip zero term */
    1.24      n = __kernel_rem_pio2(tx, y, e0, nx, 2, two_over_pi);
    1.25      if (hx < 0) {