Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ public ModuleToken GetModuleTokenForType(TypeDesc type, bool allowDynamicallyCre
{
return new ModuleToken(_manifestMutableModule, handle.Value);
}

// The reference wasn't pre-registered while resolving IL tokens. This happens on wasm when the
// method that would have registered it was skipped by the JIT (JitWasmNyiToR2RUnsupported) yet a
// fixup for the type still exists. Dynamically create the manifest reference while new tokens are
// still allowed (this runs before ManifestMetadataTableNode sets DisableNewTokens).
if (!_manifestMutableModule.DisableNewTokens)
{
handle = _manifestMutableModule.TryGetEntityHandle(type);
if (handle.HasValue)
{
return new ModuleToken(_manifestMutableModule, handle.Value);
}
}
}

// Reverse lookup failed
Expand Down
Loading