Remove potentially incorrect unsafe operation.

This commit is contained in:
Vincent St-Amour 2015-11-03 14:11:49 -06:00
parent da97da5ff8
commit f14793c462

View File

@ -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))