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

Get rid of Undefined behavior in cNoise #4386

Open
madmaxoft opened this issue Sep 7, 2019 · 1 comment

Comments

@madmaxoft
Copy link
Member

@madmaxoft madmaxoft commented Sep 7, 2019

This is a more generic followup of #4384.

The cNoise class has an undefined behavior, using signed int arithmetic and depending on it overflowing the same way on all platforms.

It should be rewritten to use the well-defined unsigned arithmetic instead, possibly casting back and forth between ints in input / output. Ideally the rewrite should not change the chunk generator output.

@madmaxoft

This comment has been minimized.

Copy link
Member Author

@madmaxoft madmaxoft commented Sep 7, 2019

Ideally, this change should also introduce some tests for the cNoise class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.