Skip to content

Commit

Permalink
Merge pull request dotnet#6033 from dotnet-bot/from-tfs
Browse files Browse the repository at this point in the history
Merge changes from TFS
  • Loading branch information
MichalStrehovsky authored Jun 29, 2018
2 parents 25e1613 + 0530110 commit d109c7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ void EmitDispatchMap(ref ObjectDataBuilder builder, NodeFactory factory)

for (int interfaceIndex = 0; interfaceIndex < declType.RuntimeInterfaces.Length; interfaceIndex++)
{
var interfaceType = declType.GetTypeDefinition().RuntimeInterfaces[interfaceIndex];
var interfaceType = declType.RuntimeInterfaces[interfaceIndex];
var interfaceDefinitionType = declType.GetTypeDefinition().RuntimeInterfaces[interfaceIndex];
Debug.Assert(interfaceType.IsInterface);

IReadOnlyList<MethodDesc> virtualSlots = factory.VTable(interfaceType).Slots;

for (int interfaceMethodSlot = 0; interfaceMethodSlot < virtualSlots.Count; interfaceMethodSlot++)
{
MethodDesc declMethod = virtualSlots[interfaceMethodSlot];
if(!interfaceType.IsTypeDefinition)
declMethod = factory.TypeSystemContext.GetMethodForInstantiatedType(declMethod.GetTypicalMethodDefinition(), (InstantiatedType)interfaceDefinitionType);

var implMethod = declType.GetTypeDefinition().ResolveInterfaceMethodToVirtualMethodOnType(declMethod);

// Interface methods first implemented by a base type in the hierarchy will return null for the implMethod (runtime interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ public bool BuildSealedVTableSlots(NodeFactory factory, bool relocsOnly)

for (int interfaceIndex = 0; interfaceIndex < declType.RuntimeInterfaces.Length; interfaceIndex++)
{
var interfaceType = declType.GetTypeDefinition().RuntimeInterfaces[interfaceIndex];
var interfaceType = declType.RuntimeInterfaces[interfaceIndex];
var interfaceDefinitionType = declType.GetTypeDefinition().RuntimeInterfaces[interfaceIndex];

virtualSlots = factory.VTable(interfaceType).Slots;

for (int interfaceMethodSlot = 0; interfaceMethodSlot < virtualSlots.Count; interfaceMethodSlot++)
{
MethodDesc declMethod = virtualSlots[interfaceMethodSlot];
if (!interfaceType.IsTypeDefinition)
declMethod = factory.TypeSystemContext.GetMethodForInstantiatedType(declMethod.GetTypicalMethodDefinition(), (InstantiatedType)interfaceDefinitionType);

var implMethod = declType.GetTypeDefinition().ResolveInterfaceMethodToVirtualMethodOnType(declMethod);

// Interface methods first implemented by a base type in the hierarchy will return null for the implMethod (runtime interface
Expand Down

0 comments on commit d109c7c

Please sign in to comment.