mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Avoid ash with arguments that might overflow in (language cps types)
Fixes https://debbugs.gnu.org/50609 * module/languages/cps/types.scm (ulsh): As stated.
This commit is contained in:
parent
bf9d30f3c3
commit
c6b1171c6b
1 changed files with 3 additions and 1 deletions
|
@ -1444,7 +1444,9 @@ minimum, and maximum."
|
|||
(define! result &s64 &s64-min &s64-max))))
|
||||
|
||||
(define-type-inferrer (ulsh a b result)
|
||||
(if (<= (ash (&max/u64 a) (&max/u64 b)) &u64-max)
|
||||
(if (and
|
||||
(or (zero? (&max/u64 a)) (< (&max/u64 b) 64)) ; don't even try
|
||||
(<= (ash (&max/u64 a) (&max/u64 b)) &u64-max))
|
||||
;; No overflow; we can be precise.
|
||||
(define! result &u64
|
||||
(ash (&min/0 a) (&min/0 b))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue