artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e102f1
)
add return statements missed when adapting from FreeBSD
author
jsg
<jsg@openbsd.org>
Wed, 1 May 2024 11:22:21 +0000
(11:22 +0000)
committer
jsg
<jsg@openbsd.org>
Wed, 1 May 2024 11:22:21 +0000
(11:22 +0000)
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
patch
|
blob
|
history
diff --git
a/lib/libm/src/s_sincosl.c
b/lib/libm/src/s_sincosl.c
index
e89d30c
..
3afb1a9
100644
(file)
--- 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. */