Fixes https://github.com/dotnet/coreclr/issues/19954
- `SetTargetInterlocked` can be soon followed by `ResetTargetInterlocked`, so the assert at the end of `SetTargetInterlocked` is invalid
- Removed the assert and instead just verified that the specified target is not the default prestub target
Commit migrated from https://github.com/dotnet/coreclr/commit/
2b698ce9bd72368f9722524573e4a77a24131700
BOOL Precode::SetTargetInterlocked(PCODE target, BOOL fOnlyRedirectFromPrestub)
{
WRAPPER_NO_CONTRACT;
+ _ASSERTE(!IsPointingToPrestub(target));
PCODE expected = GetTarget();
BOOL ret = FALSE;
// Although executable code is modified on x86/x64, a FlushInstructionCache() is not necessary on those platforms due to the
// interlocked operation above (see ClrFlushInstructionCache())
- _ASSERTE(!IsPointingToPrestub());
return ret;
}