Closed SuzanneSoy closed 7 years ago
That looks like the right fix, but I'm not completely sure whats going on. I guess there is a piece of syntax in that file that has a span of zero? I'll try to make a smaller test case this weekend.
Merged, thanks!
See travis build logs: https://travis-ci.org/jsmaniac/repltest/jobs/153136245#L378
The error happens only when the file
test/doc2-no-newline-at-end-of-file.rkt
is present, the same file with a newline at the end works fine.I narrowed down the problem to
make-byte->str-offset
, which creates an empty mapping whenstr
is the empty string""
. The(lambda (offset) …)
then tries to access the last element of the mapping, and fails because the vector is empty.I made a quick fix which returns
0
in this case, see https://github.com/florence/cover/compare/master...jsmaniac:fix-vector-ref-minus-one , but I'm quite unsure if the correct value to return here is0
, or if the problem is not somewhere else.