Skip to content

Commit 715293e

Browse files
authored
[LoongArch64] Fix the System.NullReferenceException: Object reference not set to an instance of an object. (#93186)
in Methodical_r2.sh-deep_array_nz_r.dll when DOTNET_GCStress=4.
1 parent c48aa81 commit 715293e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/coreclr/vm/gccover.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ void replaceSafePointInstructionWithGcStressInstr(UINT32 safePointOffset, LPVOID
774774
{
775775
instructionIsACallThroughImmediate = TRUE;
776776
}
777-
// jirl
778-
else if (((instr >> 26) & 0x3F) == 0x13)
777+
// jirl ra, target, offs
778+
else if ((((instr >> 26) & 0x3F) == 0x13) && ((instr & 0x1F) == 1))
779779
{
780780
instructionIsACallThroughRegister = TRUE;
781781
}
@@ -1014,7 +1014,7 @@ static PBYTE getTargetOfCall(PBYTE instrPtr, PCONTEXT regs, PBYTE* nextInstr) {
10141014
*nextInstr = instrPtr + 4;
10151015
return PC + imm26;
10161016
}
1017-
else if ((((*reinterpret_cast<DWORD*>(instrPtr)) >> 26) & 0x3F) == 0x13)
1017+
else if (((((*reinterpret_cast<DWORD*>(instrPtr)) >> 26) & 0x3F) == 0x13) && (((*reinterpret_cast<DWORD*>(instrPtr)) & 0x1F) == 1))
10181018
{
10191019
// call through register
10201020
*nextInstr = instrPtr + 4;

0 commit comments

Comments
 (0)