Skip to content

Commit

Permalink
libm: one more static analysis fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 10, 2018
1 parent 67a48ad commit 2dc04b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libm/k_rem_pio2.c
Expand Up @@ -190,7 +190,9 @@ int32_t attribute_hidden __kernel_rem_pio2(double *x, double *y, int e0, int nx,
iq[i] = (int32_t)(z-two24*fw);
z = q[j-1]+fw;
}
iq[jz] = 0;
if (jz < SDL_arraysize(iq)) {
SDL_memset(&iq[jz], 0, sizeof (q) - (jz * sizeof (iq[0])));
}

/* compute n */
z = scalbn(z,q0); /* actual value of z */
Expand Down Expand Up @@ -273,6 +275,9 @@ int32_t attribute_hidden __kernel_rem_pio2(double *x, double *y, int e0, int nx,
for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k];
fq[jz-i] = fw;
}
if ((jz+1) < SDL_arraysize(f)) {
SDL_memset(&fq[jz+1], 0, sizeof (fq) - ((jz+1) * sizeof (fq[0])));
}

/* compress fq[] into y[] */
switch(prec) {
Expand Down

0 comments on commit 2dc04b4

Please sign in to comment.