From: Taylor R Campbell Date: Sun, 25 Aug 2019 19:03:01 +0000 (+0000) Subject: Work around buggy libm on NetBSD/aarch64. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~66^2~3 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b9a7ebc36284d8b45df9eeef054f8a9053cadc86;p=mit-scheme.git Work around buggy libm on NetBSD/aarch64. Will be fixed upstream but it doesn't hurt to add one more bit here. --- 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!