Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Povazan <55002338+ivanpovazan@users.noreply.github.com>2022-08-04 18:19:09 +0300
committerGitHub <noreply@github.com>2022-08-04 18:19:09 +0300
commitef848cfa83ea16b8afbd5b933968b1838df19505 (patch)
tree87afce99a27a07ba7e6683932a0b51bba1e1b2bf
parentb47465f84ee44bc8beb645ae7ca63f57fd068c8a (diff)
Backporting https://github.com/dotnet/runtime/pull/59861 (#21531)
Fixes https://github.com/dotnet/runtime/issues/72181
-rw-r--r--mono/mini/method-to-ir.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c
index 6e3a4860ded..3c6c5d8a868 100644
--- a/mono/mini/method-to-ir.c
+++ b/mono/mini/method-to-ir.c
@@ -7455,9 +7455,12 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
ERROR_DECL (error);
MonoMethod *new_cmethod = mono_class_get_virtual_method (sp [0]->klass, cmethod, FALSE, error);
- mono_error_assert_ok (error);
- cmethod = new_cmethod;
- virtual_ = FALSE;
+ if (is_ok (error)) {
+ cmethod = new_cmethod;
+ virtual_ = FALSE;
+ } else {
+ mono_error_cleanup (error);
+ }
}
if (cmethod && method_does_not_return (cmethod)) {