-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: prevent null CO access when cloning sampler or preview #13740
fix: prevent null CO access when cloning sampler or preview #13740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I guess, though I'll let someone else that reviewed this code be the judge.
(deckToClone->m_stemGain.empty() && | ||
deckToClone->m_stemMute.empty())) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verify blow includes this check and sticks around at release time. So this check can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does but it's not equivalent.
Having the two vector empty is an expected case, for which we do an early return. The assert condition adds extra usecase that would crash the for-loop but are not expected usecase on which we should assert.
I agree that this would technically add couple of extra instructions at release time, but since this function is not time critical, I would suggest we keep the clear distinction between the early return on excepted usecase, and protective return on unexpected case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. How about replacing the first loop by
If (isPrimaryDeck())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds much cleaner indeed. Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you. Please squash the fixup and I will merge.
2db06b1
to
be86cbb
Compare
Done! |
LGTM! Thank you! |
No description provided.