summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2018-01-19 22:47:47 +0100
committerJan Kotas <jkotas@microsoft.com>2018-01-19 13:47:47 -0800
commite83991cf626b81e478cce014d96276ec2993a684 (patch)
tree52ee1fdbc5a4ddea879e877d33fd79ec9de534bf /src
parent09ac422897051e0ac143917b093b125f04277f90 (diff)
downloadcoreclr-e83991cf626b81e478cce014d96276ec2993a684.tar.gz
coreclr-e83991cf626b81e478cce014d96276ec2993a684.tar.bz2
coreclr-e83991cf626b81e478cce014d96276ec2993a684.zip
Stop treating all calls to instance interface methods as callvirt (#15925)
Fixes #15827.
Diffstat (limited to 'src')
-rw-r--r--src/vm/jitinterface.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index af7e90373f..5340e2ddb0 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -5397,7 +5397,8 @@ void CEEInfo::getCallInfo(
directCall = true;
}
else
- if (pTargetMD->GetMethodTable()->IsInterface() && pTargetMD->IsVirtual())
+ // Backwards compat: calls to abstract interface methods are treated as callvirt
+ if (pTargetMD->GetMethodTable()->IsInterface() && pTargetMD->IsAbstract())
{
directCall = false;
}
@@ -5439,6 +5440,12 @@ void CEEInfo::getCallInfo(
}
else
#endif
+ if (pTargetMD->GetMethodTable()->IsInterface())
+ {
+ // Handle interface methods specially because the Sealed bit has no meaning on interfaces.
+ devirt = !IsMdVirtual(pTargetMD->GetAttrs());
+ }
+ else
{
DWORD dwMethodAttrs = pTargetMD->GetAttrs();
devirt = !IsMdVirtual(dwMethodAttrs) || IsMdFinal(dwMethodAttrs) || pTargetMD->GetMethodTable()->IsSealed();