mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-09 17:44:48 +09:00
[mono][interp] Resolve virtual method on delegates created by compiled code (#101168)
Creating a delegate would normally end up calling into the runtime via ves_icall_mono_delegate_ctor. However, jit/aot backand have a fastpath where the delegate is not fully initialized (relying on the delegate trampoline to resolve the actual method to be called when the delegate is first called). Interp delegate initialization therefore doesn't take place. If this is the case and the delegate method is virtual, we would need to resolve it based on the target object.
This commit is contained in:
parent
81ca1c4b1e
commit
2fe9b3bfe6
1 changed files with 2 additions and 0 deletions
|
@ -4098,6 +4098,8 @@ main_loop:
|
|||
// Not created from interpreted code
|
||||
g_assert (del->method);
|
||||
del_imethod = mono_interp_get_imethod (del->method);
|
||||
if (del->target && m_method_is_virtual (del->method))
|
||||
del_imethod = get_virtual_method (del_imethod, del->target->vtable);
|
||||
del->interp_method = del_imethod;
|
||||
del->interp_invoke_impl = del_imethod;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue