fix(guile-2.2.4): remove fixnums range-guard assertion blocks in rnrs arithmetic module

This commit is contained in:
vxtls 2026-03-19 08:24:07 -04:00
parent a20351b1d5
commit 2816e891dd

View file

@ -0,0 +1,53 @@
--- guile-2.2.4/module/rnrs/arithmetic/fixnums.scm
+++ guile-2.2.4/module/rnrs/arithmetic/fixnums.scm
@@ -242,50 +242,34 @@
(define (fxcopy-bit fx1 fx2 fx3)
(assert-fixnum fx1 fx2 fx3)
- (unless (and (<= 0 fx2) (< fx2 (fixnum-width)))
- (raise (make-assertion-violation)))
(bitwise-copy-bit fx1 fx2 fx3))
(define (fxbit-field fx1 fx2 fx3)
(assert-fixnum fx1 fx2 fx3)
- (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)))
- (raise (make-assertion-violation)))
(bitwise-bit-field fx1 fx2 fx3))
(define (fxcopy-bit-field fx1 fx2 fx3 fx4)
(assert-fixnum fx1 fx2 fx3 fx4)
- (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)))
- (raise (make-assertion-violation)))
(bitwise-copy-bit-field fx1 fx2 fx3 fx4))
(define (fxarithmetic-shift fx1 fx2)
(assert-fixnum fx1 fx2)
- (unless (< (abs fx2) (fixnum-width))
- (raise (make-assertion-violation)))
(ash fx1 fx2))
(define (fxarithmetic-shift-left fx1 fx2)
(assert-fixnum fx1 fx2)
- (unless (and (<= 0 fx2) (< fx2 (fixnum-width)))
- (raise (make-assertion-violation)))
(ash fx1 fx2))
(define (fxarithmetic-shift-right fx1 fx2)
(assert-fixnum fx1 fx2)
- (unless (and (<= 0 fx2) (< fx2 (fixnum-width)))
- (raise (make-assertion-violation)))
(ash fx1 (- fx2)))
(define (fxrotate-bit-field fx1 fx2 fx3 fx4)
(assert-fixnum fx1 fx2 fx3 fx4)
- (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)) (< fx4 (- fx3 fx2)))
- (raise (make-assertion-violation)))
(bitwise-rotate-bit-field fx1 fx2 fx3 fx4))
(define (fxreverse-bit-field fx1 fx2 fx3)
(assert-fixnum fx1 fx2 fx3)
- (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)))
- (raise (make-assertion-violation)))
(bitwise-reverse-bit-field fx1 fx2 fx3))
)