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

Add checks to guard against overflow in iterator methods. #76

Merged
merged 1 commit into from Nov 17, 2019
Merged

Add checks to guard against overflow in iterator methods. #76

merged 1 commit into from Nov 17, 2019

Conversation

@hermanventer
Copy link
Contributor

@hermanventer hermanventer commented Nov 8, 2019

When a generated iterator runs of the end it keeps on incrementing the index variable, which is undesirable. Furthermore the size_hint method does not guard against the index being greater than the variant count, which causes an overflow.

These issues cause our static analyses tool to generate warnings when analyzing code generated by strum, which is annoying.

Thanks for considering this.

@Peternator7 Peternator7 merged commit e981f24 into Peternator7:master Nov 17, 2019
1 check passed
1 check passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@Peternator7
Copy link
Owner

@Peternator7 Peternator7 commented Nov 17, 2019

Looks great! Thanks for the PR :)

@hermanventer hermanventer deleted the hermanventer:guard_against_overflow branch Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants