From cc60a661cbfc6e4be6283f84ea81165d2d3e77b5 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Fri, 5 Jun 2026 18:40:15 -0700 Subject: [PATCH] [Wasm R2R] Allow LDVIRTFTN call sigs to carry a type arg (MD-array methods) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../JitInterface/CorInfoImpl.ReadyToRun.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index 8c4af968d66747..017acbd4a48316 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -2670,7 +2670,10 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO ComputeMethodWithToken(targetMethod, ref pResolvedToken, constrainedType: null, unboxing: false), useInstantiatingStub)); - Debug.Assert(!pResult->sig.hasTypeArg()); + // Wasm routes all virtual calls through LDVIRTFTN (stub dispatch is unsupported), + // so the call sig may carry a type arg (e.g., MD-array intrinsics); instParamLookup + // is set up by the post-switch block below. + Debug.Assert(!pResult->sig.hasTypeArg() || _compilation.NodeFactory.Target.IsWasm); } break;