From b9a7ebc36284d8b45df9eeef054f8a9053cadc86 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 25 Aug 2019 19:03:01 +0000 Subject: [PATCH] Work around buggy libm on NetBSD/aarch64. Will be fixed upstream but it doesn't hurt to add one more bit here. --- src/runtime/arith.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/arith.scm b/src/runtime/arith.scm index 36fe945d4..453e5e246 100644 --- a/src/runtime/arith.scm +++ b/src/runtime/arith.scm @@ -965,9 +965,12 @@ USA. ((integer->flonum n #b00) => (lambda (x) ;; The primitive does not always raise inexact for us, - ;; though it does raise overflow. + ;; and on some broken libms feraiseexcept clears + ;; existing exceptions so explicitly specify overflow. (if (not (and (flo:finite? x) (int:= (flo:->integer x) n))) - (flo:raise-exceptions! (flo:exception:inexact-result))) + (flo:raise-exceptions! + (fix:or (flo:exception:overflow) + (flo:exception:inexact-result)))) x)) (else (flo:raise-exceptions! -- 2.25.1