Skip to content
Merged
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
10 changes: 8 additions & 2 deletions src/coreclr/debug/di/rsthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11525,8 +11525,14 @@ void CordbAsyncFrame::LoadGenericArgs()
{
if (m_asyncVars[i].ilVarNum == genericArgIndex)
{

HRESULT hr = GetProcess()->SafeReadStruct(m_continuationAddress + m_asyncVars[i].offset, &genericTypeParam);
// Read a target-pointer-sized value. CORDB_ADDRESS is always 8 bytes (ULONG64),
// but on x86 targets the generic arg field is only a 4-byte pointer. Using
// SIZE_T (which is pointer-sized for the DBI build, matching the target here)
// avoids reading adjacent memory. This mirrors how CordbJITILFrame::Init()
// reads the raw token via GetRegisterOrStackValue (which returns SIZE_T).
SIZE_T rawToken = 0;
HRESULT hr = GetProcess()->SafeReadStruct(m_continuationAddress + m_asyncVars[i].offset, &rawToken);
genericTypeParam = (CORDB_ADDRESS)rawToken;
IfFailThrow(hr);
break;
}
Expand Down
Loading