When running ready to run code on ARM, the ExternalMethodFixupWorker
doesn't handle the entrypoints of FCalls correctly. It tries to handle
them as compact entrypoints, but those use a different machine code
instructions and it results in an assert in debug / checked build.
This change detects the runtime supplied calls before trying to check
for the compact entrypoint.
if (fSpeculative INDEBUG(|| TRUE))
{
#ifdef _TARGET_ARM_
- if (!IsCompactEntryPointAtAddress(addr))
+ TADDR instrCodeAddr = PCODEToPINSTR(addr);
+ if (!IsCompactEntryPointAtAddress(addr) ||
+ *PTR_BYTE(instrCodeAddr) != TEP_ENTRY_INSTR1_BYTE1 ||
+ *PTR_BYTE(instrCodeAddr+1) != TEP_ENTRY_INSTR1_BYTE2)
#else // _TARGET_ARM_
if ((addr & 3) != 1 ||
*PTR_BYTE(addr) != X86_INSTR_MOV_AL ||