Harden resolveVirtualMethod against invalid types (#9989)
authorAndy Ayers <andya@microsoft.com>
Tue, 7 Mar 2017 03:31:24 +0000 (19:31 -0800)
committerGitHub <noreply@github.com>
Tue, 7 Mar 2017 03:31:24 +0000 (19:31 -0800)
commit8902cdb044587ec713f25cb2a137b9532b98e7a2
tree3ae02097ffc0eecc46c37713aa2b8d041c016685
parente42a181ae55df183a79f3bea1ae8f881682c057b
Harden resolveVirtualMethod against invalid types (#9989)

Split resolveVirtualMethod into a wrapper/helper to allow early
returns as failure reasons are discovered.

Before devirtualizing, ensure that the derived class claimed by the jit
is really a subclass of the class that introduces the virtual method.
Fail early if this is not the case.

Also add early out for interface call devirtualization. The jit currently
does not ask for this but asking for it should not trigger an assert.

Closes #9945 (along with #9959).
src/vm/jitinterface.cpp
tests/src/JIT/opt/Devirtualization/GitHub_9945_2.il [new file with mode: 0644]
tests/src/JIT/opt/Devirtualization/GitHub_9945_2.ilproj [new file with mode: 0644]