From 65bf37cbbb7290c9f52402fa380b1d3a8dae6b83 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Wed, 28 Mar 2018 01:31:20 +0200 Subject: [PATCH] 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. --- src/vm/method.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vm/method.cpp b/src/vm/method.cpp index 9b3080e..d323ef0 100644 --- a/src/vm/method.cpp +++ b/src/vm/method.cpp @@ -4409,7 +4409,10 @@ BOOL MethodDescChunk::IsCompactEntryPointAtAddress(PCODE addr) 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 || -- 2.7.4