Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/coreclr/interpreter/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6460,7 +6460,19 @@ void InterpCompiler::UpdateLocalIntervalMaps()
int32_t varIndex = suspendData->returnValueVarStackOffset;
if (varIndex != -1)
{
suspendData->returnValueVarStackOffset = m_pVars[varIndex].offset;
assert(!m_pVars[varIndex].global);
if (m_pVars[varIndex].liveStart == m_pVars[varIndex].liveEnd)
{
Comment thread
BrzVlad marked this conversation as resolved.
// The return result of the async call is not used by the method, so the allocated
// stack offset will be immediately reused by any vars that become live. Keep the
// continuation layout unchanged, but mark the return value stack offset as invalid
// so resume skips copying the stored result back to the interpreter stack.
suspendData->returnValueVarStackOffset = -1;
}
Comment thread
BrzVlad marked this conversation as resolved.
else
{
suspendData->returnValueVarStackOffset = m_pVars[varIndex].offset;
}
Comment thread
BrzVlad marked this conversation as resolved.
Comment thread
BrzVlad marked this conversation as resolved.
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/interpexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4581,7 +4581,7 @@ do \

// Explicitly copy the return value from the continuation's result storage
// to the interpreter stack.
if (pAsyncSuspendData->returnValueContinuationDataSize > 0)
if (pAsyncSuspendData->returnValueVarStackOffset != -1)
{
memcpy(LOCAL_VAR_ADDR(pAsyncSuspendData->returnValueVarStackOffset, uint8_t),
continuation->GetResultStorage(),
Expand Down
Loading