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

fix: logical out-of-bounds access in Zeta calculation #40

Merged
merged 1 commit into from
Dec 29, 2021

Conversation

jgmbenoit
Copy link
Contributor

@jgmbenoit jgmbenoit commented Dec 28, 2021

This patch fixes issue #37 as follows::
1] it may silence sanitizers by adding a NAN to the concerned arrays;
2] it emit an error message when the number of pre-coded iterations is exceeded.

@szhorvat
Copy link
Contributor

Actually adding the NaN at the end of the array should not be necessary because with the error check, the code will never go past the end of the array. The static analysers are smart enough to see this.

@jgmbenoit
Copy link
Contributor Author

I have no idea how smart are analyzers and compilers (gcc becomes more and more smart (and annoying)). On the other hand, it does not hurt to use NAN as end-of-array flag.

@ntamas ntamas merged commit 08ec2a1 into ntamas:master Dec 29, 2021
@ntamas
Copy link
Owner

ntamas commented Dec 29, 2021

Thanks a lot!

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.

3 participants