未验证 提交 5e5a0d4e 编写于 作者: J Jan Vorlicek 提交者: GitHub

Merge pull request #146 from janvorli/fix-crossgen2-devirt

Fix devirtualization in crossgen2
......@@ -82,6 +82,17 @@ protected virtual MethodDesc ResolveVirtualMethod(MethodDesc declMethod, DefType
else
{
impl = implType.FindVirtualFunctionTargetMethodOnObjectType(declMethod);
if (impl != null && (impl != declMethod))
{
MethodDesc slotDefiningMethodImpl = MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(impl);
MethodDesc slotDefiningMethodDecl = MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(declMethod);
if (slotDefiningMethodImpl != slotDefiningMethodDecl)
{
// We cannot resolve virtual method in case the impl is a different slot from the declMethod
impl = null;
}
}
}
return impl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册