Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cdac] Fix building of method signature names for class type variables #106654

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/native/managed/cdacreader/src/Legacy/SigFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ private static unsafe void AddTypeString(Target target,

case CorElementType.Var:
int varIndex = signature.ReadCompressedInteger();
if (methodInstantiation.Length > varIndex)
if (typeInstantiation.Length > varIndex)
{
AddType(target, stringBuilder, methodInstantiation[varIndex]);
AddType(target, stringBuilder, typeInstantiation[varIndex]);
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions src/native/managed/cdacreader/src/Legacy/TypeNameBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ public static void AppendMethodImpl(Target target, StringBuilder stringBuilder,
if (!th.IsNull)
{
typeInstantiationSigFormat = runtimeTypeSystem.GetInstantiation(th);
if (typeInstantiationSigFormat.IsEmpty && runtimeTypeSystem.IsArray(th, out _))
{
// For arrays, fill in the instantiation with the element type handle
// See MethodTable::GetArrayInstantiation for coreclr equivalent
typeInstantiationSigFormat = new[] { runtimeTypeSystem.GetTypeParam(th) };
}
}

SigFormat.AppendSigFormat(target, stringBuilder, signature, reader, null, null, null, typeInstantiationSigFormat, runtimeTypeSystem.GetGenericMethodInstantiation(method), true);
Expand Down
Loading