Skip to content

Commit

Permalink
make sure to check idIsNoGC on all codepaths in emitOutputInstr
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov committed Apr 9, 2024
1 parent a689c79 commit a13c832
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16497,9 +16497,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
case IF_METHOD:
case IF_METHPTR:
{
// Assume we'll be recording this call
recCall = true;

// Get hold of the argument count and field Handle
args = emitGetInsCDinfo(id);

Expand All @@ -16526,12 +16523,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
addr = (BYTE*)id->idAddr()->iiaAddr;
assert(addr != nullptr);

// Some helpers don't get recorded in GC tables
if (id->idIsNoGC())
{
recCall = false;
}

// What kind of a call do we have here?
if (id->idInsFmt() == IF_METHPTR)
{
Expand Down Expand Up @@ -16617,6 +16608,15 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)

DONE_CALL:

// Assume we'll be recording this call
recCall = true;

// Some helpers don't get recorded in GC tables
if (id->idIsNoGC())
{
recCall = false;
}

/* We update the variable (not register) GC info before the call as the variables cannot be
used by the call. Killing variables before the call helps with
boundary conditions if the call is CORINFO_HELP_THROW - see bug 50029.
Expand Down Expand Up @@ -16989,8 +16989,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
sz = sizeof(instrDesc);
}

recCall = true;

goto DONE_CALL;

default:
Expand Down

0 comments on commit a13c832

Please sign in to comment.