From 74fe7fae00d49d76f39d06e58a68446bda0290a3 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 4 Jul 2014 11:54:03 +0200 Subject: [PATCH] Fix logand range analysis. * module/language/cps/types.scm (logand): Fix range analysis. --- module/language/cps/types.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm index faa499a7e..677f542dd 100644 --- a/module/language/cps/types.scm +++ b/module/language/cps/types.scm @@ -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