Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gambiteer opened this issue Aug 27, 2024 · 1 comment
Open

Comments

@gambiteer
Copy link
Contributor

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
Copy link
Contributor Author

For that matter, this should fail, too:

> heine:~> chibi-scheme
> (import (srfi 231))
> (define A (make-specialized-array (make-interval '#(4 4)) generic-storage-class #t #t))
> (array-ref A 0 10)
#t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant