[racket-dev] [plt] Push #23009: master branch updated
On Wed, Jul 13, 2011 at 12:08 PM, <stamourv at racket-lang.org> wrote:
>
> ;; we assume indexes are 2 bits shorter than fixnums
> ;; We're generating a reference to fixnum? rather than calling it, so
> ;; we're safe from fixnum size issues on different platforms.
> -(define (index? x) (and (fixnum? x) (>= x 0) (fixnum? (* x 4))))
> +(define (index? x)
> + (and (fixnum? x) (unsafe-fx>= x 0) (fixnum? (unsafe-fx* x 4))))
How is this possibly ok? If `x' is (/ MAX_FIXNUM 2), then this code
has no semantics.
--
sam th
samth at ccs.neu.edu