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/safelist deep copy constructor #1763

Merged
merged 3 commits into from May 15, 2022
Merged

Fix/safelist deep copy constructor #1763

merged 3 commits into from May 15, 2022

Conversation

cschwier
Copy link
Contributor

@cschwier cschwier commented May 5, 2022

Fixes a bug where the copy constructor of Safelist would share state with its source Safelist which can unexpectedly mutate both safelists if the modifying operation is invoked on either.
In particular, this affected the allowed attributes, enforced attribute values and protocols.

fixes #1764

Copies nested data structures instead of using a shallow copy to avoid
unexpected state mutations after copy constructor usage.
Makes a couple of properties final which shouldn't be replaced to further
reduce the risk of unexpected mutation.
@jhy jhy added this to the 1.15.1 milestone May 15, 2022
@jhy jhy merged commit eaf5028 into jhy:master May 15, 2022
@jhy
Copy link
Owner

jhy commented May 15, 2022

Looks great, thanks Christian. Merged.

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.

Copy constructor of Safelist shares state
2 participants