Skip to content

Fix idm remove#16473

Merged
elad335 merged 5 commits into
RPCS3:masterfrom
Megamouse:idm_remove
Dec 29, 2024
Merged

Fix idm remove#16473
elad335 merged 5 commits into
RPCS3:masterfrom
Megamouse:idm_remove

Conversation

@Megamouse

@Megamouse Megamouse commented Dec 28, 2024

Copy link
Copy Markdown
Contributor

idm remove calls shared_ptr::exchange with a null_ptr.
This calls the stored object's constructor with null args.
Let's just add an exchange overload for null_ptr

fixes #16457
fixes #16458

@elad335

elad335 commented Dec 29, 2024

Copy link
Copy Markdown
Contributor

I see, instead, you can fix the definition is_stx_pointer to check for null_,ptr_t as well

idm remove calls shared_ptr::exchange with a null_ptr.
This calls the stored object's constructor with null args.
Let's just add an exchange overload for null_ptr
Comment thread rpcs3/util/shared_ptr.hpp
|| is_instance_of<std::remove_cvref_t<T1>, shared_ptr>::value
|| is_instance_of<std::remove_cvref_t<T1>, single_ptr>::value
|| is_instance_of<std::remove_cvref_t<T1>, atomic_ptr>::value;
|| std::is_same_v<std::remove_cvref_t<T1>, null_ptr_t>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to thank C++ gods that std::is_same accepts incomplete types for this ;)

@digant73

Copy link
Copy Markdown
Contributor

if I can provide a suggestion to help/simplify the user's life on testing/reporting issues, it should be better (when possible as in case of a regression) to provide info about which previous PR broke/changed something that was previously working. It will keep track of the chain of changes helping the users to easily identify the PRs to double check (possibly regressed, not regressed etc.)

@elad335 elad335 merged commit 15f29ee into RPCS3:master Dec 29, 2024
@Megamouse

Copy link
Copy Markdown
Contributor Author

Why are you randomly changing my code?
You don't even know if this works?
This is exactly why we are in these crap situations

Xcedf pushed a commit to Xcedf/rpcs3 that referenced this pull request Jan 19, 2025
* Fix idm remove

idm::remove calls shared_ptr::exchange with a null_ptr.
This calls the stored object's constructor with null args.

---------

Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants