Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/9.0] [mono] inflate function pointer types; hang indirect ca…
…ll wrappers on the <Module> (#106926) * [mono] inflate function pointer types; hang indirect call wrappers on the <Module> 1. We were missing a case for `MONO_TYPE_FNPTR` in `inflate_generic_type` 2. When an indirect call was inside of a method that was part of a generic class, we were creating wrapper methods for the indirect calls parented by the GTD type of the caller. This ended up making common_call_trampoline consider the wrapper as needing an mrgctx. But if the caller was actually a normal closed instance type no mrgctx is set up. So we end up dereferencing a null pointer. Instead, when we create an indirect call wrapper method (which we asserted has no type params and which is always just sets up the GC transition and forwards the arguments to the indirect callee - so it never depends on the generic context), make its parent be the <Module> class of the calling assembly. This is consistent with how we cache these indirect methods (in the calling image, by the signature of the indirect callee) - it has nothing to do with the caller class. Fixes #106811 * pay attention to `changed` when inflating if the cmods changed, but the sig didn't we want to return `type`. return NULL only if there's an error or if nothing else changed * add regression test --------- Co-authored-by: Aleksey Kliger <alklig@microsoft.com> Co-authored-by: Aleksey Kliger <aleksey@lambdageek.org>
- Loading branch information