diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2018-03-21 18:32:53 +0300 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2018-03-21 18:32:53 +0300 |
commit | 0e7e9dd4254ea456c15d8e1fc16295876578ee81 (patch) | |
tree | 4cc557191703e9c0f468862ae2b367b4f22de204 /src | |
parent | c6b58e796875d1bf70328c9f2ebe78af009b3cb4 (diff) |
ProjectX: Bug fix for sealed vtable entries for dynamic SzArray types
Interface method implemented by USG code should have the calling convention converter wrapper in the vtable instead of the real target. The change fixes a bug in the sealed vtable generation for dynamic SzArray type where underlying System.Array type should be used instead of the SzArray type.
The bug causes an AppCompat execution failure where the real interface method implementation is called directly without being gone through the calling convention converter wrapper.
[tfs-changeset: 1692786]
Diffstat (limited to 'src')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs index d83ba988c..b675e6016 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs @@ -1465,6 +1465,7 @@ namespace ILCompiler.DependencyAnalysis currentVTableIndex++; int sealedVTableSlot = 0; + DefType closestDefType = implType.GetClosestDefType(); // Actual vtable slots follow foreach (MethodDesc declMethod in vtableEntriesToProcess) @@ -1472,13 +1473,13 @@ namespace ILCompiler.DependencyAnalysis // No generic virtual methods can appear in the vtable! Debug.Assert(!declMethod.HasInstantiation); - MethodDesc implMethod = implType.GetClosestDefType().FindVirtualFunctionTargetMethodOnObjectType(declMethod); + MethodDesc implMethod = closestDefType.FindVirtualFunctionTargetMethodOnObjectType(declMethod); if (implMethod.CanMethodBeInSealedVTable() && !implType.IsArrayTypeWithoutGenericInterfaces()) { // Sealed vtable entries on other types in the hierarchy should not be reported (types read entries // from their own sealed vtables, and not from the sealed vtables of base types). - if (implMethod.OwningType == implType) + if (implMethod.OwningType == closestDefType) operation(sealedVTableSlot++, true, declMethod, implMethod); } else |