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 uninitalized values in Waveshaper #993

Merged

Conversation

falkTX
Copy link
Contributor

@falkTX falkTX commented Mar 9, 2024

Fixes #992

1st change is needed for the case where plugin UI runs while Rack/Cardinal is bypassed which makes this:

ddb = module->modulationAssistant.values[Waveshaper::DRIVE][ch];

read uninitialized values (they are only set during processing)

2nd change is more obvious, fixes the use of displayPolyChannel which does not have a value set.
This also matches what https://cplusplus.com/reference/atomic/atomic/atomic/ says

(1) default constructor
Leaves the atomic object in an uninitialized state.

which I didn't know it was a thing, I thought std::atomic types would initialize to 0...

Signed-off-by: falkTX <falktx@falktx.com>
@baconpaul
Copy link
Contributor

Thanks!

On the second one {} would also work since that would use the default constructor for T but nothing is indeed an error and {0} is most appropriate.

@baconpaul baconpaul merged commit bb3cf75 into surge-synthesizer:main Mar 9, 2024
8 checks passed
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.

Use of uninitialised value in waveshaper panel
2 participants