diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-08-04 19:13:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 19:13:18 +0300 |
commit | e7c645a340afdcc1ce24abd9998c668543d9a475 (patch) | |
tree | 385a53e01d6278f771a130585b276314ca701700 | |
parent | 2a19f878dab8d2e62123e0bf29453de553f5402a (diff) |
Backporting https://github.com/dotnet/runtime/pull/59861 (#21532)mono-6.12.0.184
Fixes https://github.com/dotnet/runtime/issues/72181
Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
-rw-r--r-- | mono/mini/method-to-ir.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 8fa2b3feec7..01e4390412e 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -7238,9 +7238,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)) { |