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

VMManager: Avoid use-after-move conditions #12274

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

F0bes
Copy link
Member

@F0bes F0bes commented Feb 4, 2025

Description of Changes

Removes two possible move-after-frees in the vmmanager

Rationale behind Changes

Using an object (like an std::string) after it has been moved I believe is undefined behaviour, or implementation defined behaviour. Not good nonetheless.

Suggested Testing Steps

Change discs and savestate when you can't rename to backup.

Copy link
Member

@TellowKrinkle TellowKrinkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an object (like an std::string) after it has been moved I believe is undefined behaviour, or implementation defined behaviour. Not good nonetheless.

Moves leave the input in a valid but otherwise indeterminate state, so no UB.
Still not very helpful though.

@F0bes
Copy link
Member Author

F0bes commented Feb 5, 2025

Using an object (like an std::string) after it has been moved I believe is undefined behaviour, or implementation defined behaviour. Not good nonetheless.

Moves leave the input in a valid but otherwise indeterminate state, so no UB. Still not very helpful though.

Thanks for the clarification.

@F0bes F0bes merged commit 1f0d6f0 into master Feb 5, 2025
22 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.

3 participants