Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 65bf37c

Browse files
authored
Fix handling of FCalls in ExternalMethodFixupWorker (#17252)
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.
1 parent 289ebe6 commit 65bf37c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vm/method.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4409,7 +4409,10 @@ BOOL MethodDescChunk::IsCompactEntryPointAtAddress(PCODE addr)
44094409
if (fSpeculative INDEBUG(|| TRUE))
44104410
{
44114411
#ifdef _TARGET_ARM_
4412-
if (!IsCompactEntryPointAtAddress(addr))
4412+
TADDR instrCodeAddr = PCODEToPINSTR(addr);
4413+
if (!IsCompactEntryPointAtAddress(addr) ||
4414+
*PTR_BYTE(instrCodeAddr) != TEP_ENTRY_INSTR1_BYTE1 ||
4415+
*PTR_BYTE(instrCodeAddr+1) != TEP_ENTRY_INSTR1_BYTE2)
44134416
#else // _TARGET_ARM_
44144417
if ((addr & 3) != 1 ||
44154418
*PTR_BYTE(addr) != X86_INSTR_MOV_AL ||

0 commit comments

Comments
 (0)