Fix resolveVirtualMethodHelper to check for explicit override cases
authorAndy Ayers <andya@microsoft.com>
Fri, 3 Aug 2018 02:20:48 +0000 (19:20 -0700)
committerAndy Ayers <andya@microsoft.com>
Fri, 3 Aug 2018 02:24:51 +0000 (19:24 -0700)
commit377c01007c9ccb10a95b957ad829e78aa90db64e
treec0c429359cf7632dafef0c92925bba3fb554b9bd
parent6d5b666b18366a07acd4768d8c739d4b92a4b04b
Fix resolveVirtualMethodHelper to check for explicit override cases

Explicit method overrides in a class can override a virtual final method
with different method. This is only possible if the different method
first is introduced in a new slot. So when devirtualizing, verify that the
slot of the derived method matches the slot of the base method.

If they don't match, just bail on devirtualizing.

Fixes dotnet/coreclr#19222.

Commit migrated from https://github.com/dotnet/coreclr/commit/50584f2129b7b76a6567bce8879031cf974af15e
src/coreclr/src/vm/jitinterface.cpp
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19222/GitHub_19222.il [new file with mode: 0644]
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_19222/GitHub_19222.ilproj [new file with mode: 0644]