[racket-dev] [plt] Push #23009: master branch updated

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Wed Jul 13 12:25:42 EDT 2011

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



Posted on the dev mailing list.