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

Minimal solution for infinite loop #1395

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomasdenH
Copy link

This is a minimal solution to #1391.

As discussed there, the current behaviour for allocating matrices is

  • Vec, Iterator or slice to Const storage:
    - If too small, panic
    - If too large, ignore remaining entries
  • Vec, Iterator or slice to Dyn storage:
    - If too small, panic
    - If too large and finite, panic
    - If too large and infinite, loop indefinitely

This PR merely merges the last two cases and always panics with the same message:

  • Vec, Iterator or slice to Const storage:
    - If too small, panic
    - If too large, ignore remaining entries
  • Vec, Iterator or slice to Dyn storage:
    - If too small, panic
    - If too large, panic

I think it is highly unlikely that existing code relied on the infinite loop behaviour (which would most likely crash if the vec grew too big anyway), and therefore I think this can be safely merged without impacting any existing code. This leaves the decision as to what the desired behaviour would be for later.

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.

1 participant