Skip to content
Merged
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
13 changes: 12 additions & 1 deletion src/coreclr/tools/dotnet-pgo/TraceRuntimeDescToTypeSystemDesc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,18 @@ public TypeDesc ResolveTypeHandle(long handle, ref bool dependsOnKnownNonLoadabl
throw new Exception($"Invalid typedef {tinfo.TypeValue.TypeNameID:4x}");
}

TypeDefinitionHandle typedef = MetadataTokens.TypeDefinitionHandle(tinfo.TypeValue.TypeNameID & 0xFFFFFF);
int typedefRow = tinfo.TypeValue.TypeNameID & 0xFFFFFF;
// The runtime emits BulkType events for "minimal" MethodTables created by
// CreateMinimalMethodTable in coreclr (used for Reflection.Emit DynamicMethod
// hosts and the IL stub cache). These MTs have no typedef token and surface
// here as TypeNameID == 0x02000000 (rid 0). Treat them as unresolvable
// dynamic types so trace processing can continue.
if (typedefRow == 0)
{
dependsOnKnownNonLoadableType = true;
return null;
}
Comment thread
DrewScoggins marked this conversation as resolved.
TypeDefinitionHandle typedef = MetadataTokens.TypeDefinitionHandle(typedefRow);
MetadataType uninstantiatedType = (MetadataType)ecmaModule.GetType(typedef);
// Instantiate the type if requested
if ((tinfo.TypeValue.TypeParameters.Length != 0) && uninstantiatedType != null)
Expand Down
Loading