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

Typemap: Set init to false after each individual destructor #14931

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

Megamouse
Copy link
Contributor

Fixes crashes when fxo destructors call other fxo.

@Megamouse Megamouse marked this pull request as draft December 23, 2023 21:09
@elad335
Copy link
Contributor

elad335 commented Dec 23, 2023

Great catch!!

@@ -299,21 +299,22 @@ namespace stx
}

// Get actual number of created objects
u32 _max = 0;
std::vector<usz> types_to_destroy;
Copy link
Contributor

Choose a reason for hiding this comment

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

Althogh this is probably not needed, there must be another way to get the typeinfo index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's wrong anyway, since it's the wrong order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably fixed now

@Megamouse Megamouse force-pushed the debug_overlay branch 3 times, most recently from ed71558 to 0b94b4a Compare December 23, 2023 22:04
@Megamouse Megamouse marked this pull request as ready for review December 23, 2023 22:07
info->destroy(*--m_order);

// Set init to false. We don't want other fxo to use this fxo in their destructor.
m_init[type_index] = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do it in info->destroy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not the same object?

Copy link
Contributor

@elad335 elad335 Dec 24, 2023

Choose a reason for hiding this comment

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

I mean, move this line to typeinfo::call_dtor. You can cast it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's a static function...

Copy link
Contributor

Choose a reason for hiding this comment

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

Then pass it as argument or smth

Copy link
Contributor

Choose a reason for hiding this comment

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

And do it in auto_typemap.hpp too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry but I don't have the time to make this code even more spaghetti-like

@elad335 elad335 merged commit 3f5a80d into RPCS3:master Dec 25, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants