1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

Fix logand range analysis.

* module/language/cps/types.scm (logand): Fix range analysis.
This commit is contained in:
Andy Wingo 2014-07-04 11:54:03 +02:00
parent 42b544ebbc
commit 74fe7fae00

View file

@ -991,13 +991,13 @@ minimum, and maximum."
(define-simple-type-checker (logand &exact-integer &exact-integer))
(define-type-inferrer (logand a b result)
(define (logand-min a b)
(if (< a b 0)
(if (and (negative? a) (negative? b))
(min a b)
0))
(define (logand-max a b)
(if (< a b 0)
0
(max a b)))
(if (and (positive? a) (positive? b))
(min a b)
0))
(restrict! a &exact-integer -inf.0 +inf.0)
(restrict! b &exact-integer -inf.0 +inf.0)
(define! result &exact-integer