From 6d0e0ea40cabe06eb91dafad4aa1476fddfee3c7 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 7 Dec 2018 04:12:03 +0000 Subject: [PATCH] Fix bug in flo:make-nan error reporting. error_bad_range_arg takes argument number, not argument value. --- src/microcode/flonum.c | 2 +- tests/runtime/test-flonum.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/microcode/flonum.c b/src/microcode/flonum.c index d6330b968..051440bcc 100644 --- a/src/microcode/flonum.c +++ b/src/microcode/flonum.c @@ -564,7 +564,7 @@ DEFINE_PRIMITIVE ("FLONUM-MAKE-NAN", Prim_flonum_make_nan, 3, 3, 0) uint64_t i; } u = { .i = 0 }; if ((!quiet) && (payload == 0)) - error_bad_range_arg (payload); + error_bad_range_arg (3); (u.i) |= (sign << 63); (u.i) |= ((UINT64_C (0x7ff)) << 52); (u.i) |= (quiet << 51); diff --git a/tests/runtime/test-flonum.scm b/tests/runtime/test-flonum.scm index 92895ef79..e68e57ce1 100644 --- a/tests/runtime/test-flonum.scm +++ b/tests/runtime/test-flonum.scm @@ -1155,8 +1155,8 @@ USA. (lambda () (flo:logb (flo:negate x)))))) (define-enumerated-test 'flo:make-nan/error - `((#f #f 0 ,expect-error) - (#t #f 0 ,expect-error)) + `((#f #f 0) + (#t #f 0)) (lambda (sign quiet? payload #!optional xfail) (with-expected-failure xfail (lambda () -- 2.25.1