Skip to content

Avoid infinite loop possibility with takeEnd #133

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

Merged
merged 2 commits into from
Nov 2, 2017

Conversation

mlms13
Copy link
Contributor

@mlms13 mlms13 commented Nov 2, 2017

Calling takeEnd with an Int value greater than the length of the list currently leads to an infinite loop. I added a couple test cases to demonstrate this and added a guard in drop against negative Ints.

@paf31
Copy link
Contributor

paf31 commented Nov 2, 2017

Thanks! Would you like to fix take too?

@mlms13
Copy link
Contributor Author

mlms13 commented Nov 2, 2017

Good call, I added some tests and a guard there as well.

@paf31 paf31 merged commit 6c8aaad into purescript:master Nov 2, 2017
@paf31
Copy link
Contributor

paf31 commented Nov 2, 2017

Thanks!

@mlms13 mlms13 deleted the negative-drop branch November 3, 2017 01:58
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.

2 participants