From: jsg Date: Wed, 1 May 2024 11:22:21 +0000 (+0000) Subject: add return statements missed when adapting from FreeBSD X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=65a55a55c7a1ceb83f2b4bc7b773d473ee2e30fb;p=openbsd add return statements missed when adapting from FreeBSD Avoids segfaults with an argument of 0, NaN, or Inf. Problem reported by Colin Ian King. ok miod@ kettenis@ --- diff --git a/lib/libm/src/s_sincosl.c b/lib/libm/src/s_sincosl.c index e89d30c4b90..3afb1a950a6 100644 --- a/lib/libm/src/s_sincosl.c +++ b/lib/libm/src/s_sincosl.c @@ -72,12 +72,14 @@ sincosl(long double x, long double *sn, long double *cs) *cs = 1; } else __kernel_sincosl(x, 0, 0, sn, cs); + return; } /* If x = NaN or Inf, then sin(x) and cos(x) are NaN. */ if (z.bits.ext_exp == 32767) { *sn = x - x; *cs = x - x; + return; } /* Split z.e into a 24-bit representation. */