chibi-scheme icon indicating copy to clipboard operation
chibi-scheme copied to clipboard

SRFI 231: array-extract doesn't preserve safety for specialized arrays

Open gambiteer opened this issue 1 year ago • 2 comments

The symptom: This should fail, the indices are out of bounds:

 > heine:~/programs/chibi-scheme> chibi-scheme
> (import (srfi 231))
> (define A (make-specialized-array (make-interval '#(4 4)) generic-storage-class #t #t))
> (define B (array-extract A (make-interval '#(2 2))))
>  (array-ref B 2 2) 
#t

I think something is a problem with specialized-array-share or %make-specialized-array, but I don't know where, precisely.

I just sent a pull request to fix this in the sample implementation and test suite.

gambiteer avatar Aug 27 '24 16:08 gambiteer