Skip to content

Commit 097ccd9

Browse files
committed
Cleanup fixme comments
1 parent 41c04e7 commit 097ccd9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/coreclr/vm/interpexec.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,12 +2001,14 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
20012001
if (isTailcall)
20022002
{
20032003
// Move args from callArgsOffset to start of stack frame.
2004-
// Interpreter-FIXME: GC refs
2005-
// Interpreter-FIXME: Validate return address offset
20062004
InterpMethod* pTargetMethod = targetIp->Method;
20072005
assert(pTargetMethod->CheckIntegrity());
2008-
memcpyNoGCRefs(pFrame->pStack, stack + callArgsOffset, pTargetMethod->argsSize);
2009-
// Reuse current stack frame.
2006+
// It is safe to use memcpy because the source and destination are both on the interp stack, not in the GC heap.
2007+
// We need to use the target method's argsSize, not our argsSize, because tail calls (unlike CEE_JMP) can have a
2008+
// different signature from the caller.
2009+
memcpy(pFrame->pStack, stack + callArgsOffset, pTargetMethod->argsSize);
2010+
// Reuse current stack frame. We discard the call insn's returnOffset because it's not important and tail calls are
2011+
// required to be followed by a ret, so we know nothing is going to read from stack[returnOffset] after the call.
20102012
pFrame->ReInit(pFrame->pParent, targetIp, pFrame->pRetVal, pFrame->pStack);
20112013
}
20122014
else

0 commit comments

Comments
 (0)