Skip to content

Commit e7c645a

Browse files
Fixes dotnet/runtime#72181 Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
1 parent 2a19f87 commit e7c645a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mono/mini/method-to-ir.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7238,9 +7238,12 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
72387238
ERROR_DECL (error);
72397239

72407240
MonoMethod *new_cmethod = mono_class_get_virtual_method (sp [0]->klass, cmethod, FALSE, error);
7241-
mono_error_assert_ok (error);
7242-
cmethod = new_cmethod;
7243-
virtual_ = FALSE;
7241+
if (is_ok (error)) {
7242+
cmethod = new_cmethod;
7243+
virtual_ = FALSE;
7244+
} else {
7245+
mono_error_cleanup (error);
7246+
}
72447247
}
72457248

72467249
if (cmethod && method_does_not_return (cmethod)) {

0 commit comments

Comments
 (0)