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

Adding null check for result of mini_get_method #1796

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

bholmes
Copy link
Member

@bholmes bholmes commented Aug 7, 2023

  • Should this pull request have release notes?
    • Yes
    • No
  • Do these changes need to be back ported?
    • Yes
    • No
  • Do these changes need to be upstreamed to mono/mono or dotnet/runtime repositories?
    • Yes
    • No

Release notes

Fixed UUM-45293 @bholmes :
Mono: Fix Editor crash when mini_get_method fails.

Backports

  • 2023.3
  • 2023.2
  • 2023.1
  • 2022.3
  • 2021.3

@bholmes bholmes requested a review from joncham August 7, 2023 19:29
@@ -9242,7 +9242,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
guint32 gettype_token;
if ((ip = il_read_call(next_ip, end, &gettype_token)) && ip_in_bb (cfg, cfg->cbb, ip)) {
MonoMethod* gettype_method = mini_get_method (cfg, method, gettype_token, NULL, generic_context);
if (!strcmp (gettype_method->name, "GetType") && gettype_method->klass == mono_defaults.object_class) {
if (gettype_method && !strcmp (gettype_method->name, "GetType") && gettype_method->klass == mono_defaults.object_class) {
Copy link
Member

Choose a reason for hiding this comment

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

Does this fail due to invalid assemblies?

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.

2 participants