From 15ded2d2f3643f12e3bf9712a33d1b15414ef928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 16 Oct 2026 22:35:46 +0900 Subject: [PATCH] Avoid tagged shared dynamic-interface vtable entries on WASM Emit null sealed-vtable entries for unsupported shared IDynamicInterfaceCastable implementations. WASM function-pointer relocation addends identify funclets and cannot encode the instantiating-thunk flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a6f3a617-acae-4f4f-95d3-20b2a0bac43c --- .../Compiler/DependencyAnalysis/SealedVTableNode.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/SealedVTableNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/SealedVTableNode.cs index 2d994f76ec054c..33ceb9618123e7 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/SealedVTableNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/SealedVTableNode.cs @@ -274,6 +274,13 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly) for (int i = 0; i < _sealedVTableEntries.Count; i++) { + // TODO: shared IDynamicInterfaceCastable methods are problematic on WASM + if (factory.Target.IsWasm && isSharedDynamicInterfaceCastableImpl) + { + objData.EmitZeroPointer(); + continue; + } + IMethodNode relocTarget = _sealedVTableEntries[i].Target; int delta = isSharedDynamicInterfaceCastableImpl ? DispatchMapCodePointerFlags.RequiresInstantiatingThunkFlag : 0;