Skip to content

Commit 6334dfb

Browse files
author
Andrew Kent
authored
fix the maximum range for type-masks
1 parent 25419f9 commit 6334dfb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

typed-racket-lib/typed-racket/rep/type-mask.rkt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;;
1212
;; - - Details - -
1313
;;
14-
;; Type masks are represented with a simple 31-bit fixnum.
14+
;; Type masks are represented with a simple 30-bit fixnum.
1515
;;
1616
;; If a bit flag in a Type's bitmask is set to 1, it means the Type
1717
;; _may_ overlap with the values described by that bit flag.
@@ -51,10 +51,13 @@
5151
;; type mask predicate
5252
(define-syntax type-mask? (make-rename-transformer #'fixnum?))
5353

54-
;; define the max size of type masks
54+
;; define the max size of type masks -- if we limit the size to
55+
;; 30 we are guaranteed to be a fixnum on 32 and 64 bit machines.
56+
;; (30 is the max number of bits available in a 2's complement
57+
;; tagged integer on a 32-bit machine)
5558
(module const racket/base
5659
(provide max-mask-size)
57-
(define max-mask-size 31))
60+
(define max-mask-size 30))
5861
(require 'const (for-syntax 'const))
5962

6063

0 commit comments

Comments
 (0)