Skip to content
Draft
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
20 changes: 17 additions & 3 deletions src/coreclr/tools/aot/crossgen2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,24 @@ private TypeDesc FindType(CompilerTypeSystemContext context, string typeName)
TypeDesc foundType = systemModule.GetTypeByCustomAttributeTypeName(typeName, false,
(module, typeDefName) => (MetadataType)module.Context.GetCanonType(typeDefName));

if (foundType == null)
throw new CommandLineException(string.Format(SR.TypeNotFound, typeName));
if (foundType != null)
return foundType;

return foundType;
// In composite mode the method we care about may be in any one of the input files, not just the system module.
if (Get(_command.Composite))
{
foreach (var searchModulePath in context.InputFilePaths.Values)
{
var searchModule = context.GetModuleFromPath(searchModulePath, true);
foundType = searchModule.GetTypeByCustomAttributeTypeName(typeName, false,
(module, typeDefName) => (MetadataType)module.Context.GetCanonType(typeDefName));

if (foundType != null)
return foundType;
}
}

throw new CommandLineException(string.Format(SR.TypeNotFound, typeName));
}

private MethodDesc CheckAndParseSingleMethodModeArguments(CompilerTypeSystemContext context)
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,9 @@ MethodTable * MethodDesc::GetExactDeclaringType(MethodTable * ownerOrSubType)
// will match, but the types are actually from unrelated arrays, so the result would be incorrect.
_ASSERTE(!IsArray());

return ownerOrSubType->GetMethodTableMatchingParentClass(pMT);
MethodTable * result = ownerOrSubType->GetMethodTableMatchingParentClass(pMT);
_ASSERTE(result);
return result;
}

//*******************************************************************************
Expand Down
3 changes: 0 additions & 3 deletions src/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,6 @@
<ExcludeList Include="$(XunitTestBinBase)/JIT/superpmi/superpmicollect/*">
<Issue>Not compatible with crossgen2</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTestDefaultImp/**">
<Issue>https://github.com/dotnet/runtime/issues/109200</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTest/**">
<Issue>https://github.com/dotnet/runtime/issues/109200</Issue>
</ExcludeList>
Expand Down
Loading