[racket-dev] Fixing "uncertified context" error in in-vector

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Dec 5 08:38:48 EST 2010

It looks like a problem with certificates, the custom expander for
`define-sequence-syntax', and fact that `make-in-vector-like'
originates from a module other than the one containing the

For now, just export `normalise-inputs'. Ryan and I are looking to an
overhaul of syntax certificates.

Also, you're using `unsafe-fx...' on numbers that haven't been checked
to be fixnums (i.e., `exact-nonnegative-integer?' does not imply
fixnum). I think you should just use generic arithmetic.

The bug fix and documentation improvements are much appreciated!

At Sun, 5 Dec 2010 08:28:08 +0000, Noel Welsh wrote:
> While doing my last change to in-vector I discovered a bug (that has
> been there for a long time, I think). To fix it I refactored the code
> and changed the invariants slightly, so start, stop, and step are now
> checked before the sequence runs. (The bug was the use of
> unsafe-vector-ref without checking the indices were in range). I now
> get this error in the tests:
> Section(fixnum)
> ERROR: compile: access from an uncertified context to unexported
> variable from module:
> "/usr/local/plt-head/collects/racket/private/for.rkt" in:
> normalise-inputs
> I have no clue how to fix it. Diff is attached. Any suggestions would be great.
> N.

Posted on the dev mailing list.