diff --git a/release_notes/release_notes.stex b/release_notes/release_notes.stex index e5b2c6cc6..68ccede9f 100644 --- a/release_notes/release_notes.stex +++ b/release_notes/release_notes.stex @@ -2984,6 +2984,9 @@ When \scheme{>} and \scheme{>=} are applied to two non-real arguments, the first is now reported as incorrect instead of the second. In general, when two or more arguments are invalid, there is no guarantee about which one is reported invalid. +A bug in the error produced by \scheme{bytevector-ieee-double-native-set!} when the last +argument raises and error and the offset is out of bounds has been fixed. + \subsection{Fix \scheme{remainder} and \scheme{modulo} for inexact/exact mixtures (10.4.0)} When \scheme{remainder} and \scheme{modulo} receive an inexact first diff --git a/s/cpprim.ss b/s/cpprim.ss index 01a0e2260..d8f873704 100644 --- a/s/cpprim.ss +++ b/s/cpprim.ss @@ -7200,11 +7200,11 @@ (define-inline 2 bytevector-ieee-double-native-set! [(e-bv e-offset e-val) (bind #t (e-bv e-offset) - (let ([info (make-info-call #f #f #f #f #f)]) - `(if (call ,info ,#f ,(lookup-primref 3 '$bytevector-set!-check?) (quote 64) ,e-bv ,e-offset) - ;; checks to make sure e-val produces a real number: - (call ,info ,#f ,(lookup-primref 3 'bytevector-ieee-double-native-set!) ,e-bv ,e-offset ,e-val) - ,(build-libcall #t src sexpr bytevector-ieee-double-native-set! e-bv e-offset))))])) + (bind #f fp ([e-val (build-$real->flonum src sexpr `(quote bytevector-ieee-double-native-set!) e-val)]) + (let ([info (make-info-call #f #f #f #f #f)]) + `(if (call ,info ,#f ,(lookup-primref 3 '$bytevector-set!-check?) (quote 64) ,e-bv ,e-offset) + (call ,info ,#f ,(lookup-primref 3 'bytevector-ieee-double-native-set!) ,e-bv ,e-offset ,e-val) + ,(build-libcall #t src sexpr bytevector-ieee-double-native-set! e-bv e-offset)))))])) (let () (define-syntax define-bv-int-ref-inline