From 65a55a55c7a1ceb83f2b4bc7b773d473ee2e30fb Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 1 May 2024 11:22:21 +0000 Subject: [PATCH] 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@ --- lib/libm/src/s_sincosl.c | 2 ++ 1 file changed, 2 insertions(+) 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. */ -- 2.20.1