diff --git a/typed-racket-lib/typed-racket/base-env/prims.rkt b/typed-racket-lib/typed-racket/base-env/prims.rkt index da4921b3..0ac4028b 100644 --- a/typed-racket-lib/typed-racket/base-env/prims.rkt +++ b/typed-racket-lib/typed-racket/base-env/prims.rkt @@ -808,7 +808,13 @@ the typed racket language. (define i 0) (for (clauses ...) (define v body-expr) - (cond [(unsafe-fx= i 0) (define new-vs (ann (make-vector n v) T)) + ;; can't use `unsafe-fx=` here + ;; if `n` is larger than a fixnum, this is unsafe, and we + ;; don't know whether that's the case until we try creating + ;; the vector + ;; other unsafe ops are after vector allocation, and so are + ;; fine + (cond [(= i 0) (define new-vs (ann (make-vector n v) T)) (set! vs new-vs)] [else (unsafe-vector-set! vs i v)]) (set! i (unsafe-fx+ i 1))