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

Check for negative integer indices when doing indexing-out-of-bounds checks #862

Merged
merged 4 commits into from
Aug 12, 2020

Conversation

robdockins
Copy link
Contributor

Fixes #861

I'd like to add some tests and do some additional checking, but I think this fixes the issue.

Related, however: :check should probably fail when we encounter an error condition, the same way that :prove does. Right now, I think it just accepts crashing test cases as passing.

Copy link
Contributor

@brianhuffman brianhuffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new bounds checks all look good to me. With the addition of some tests we'll be good to go.

@robdockins
Copy link
Contributor Author

Disregard my comment above about :check accepting invalid test arguments. The problem, in fact, was that the test just didn't hit upon cases where the input sequence was all zeros, as specified by the test, so it passes even though negative indices are selected.

determinsitic enough for a regression test.
@robdockins robdockins merged commit 7cb9dc2 into master Aug 12, 2020
@RyanGlScott RyanGlScott deleted the issue861 branch March 22, 2024 14:44
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

Successfully merging this pull request may close these issues.

:check crash on negative Integer index
2 participants