Skip to content
Open
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
18 changes: 18 additions & 0 deletions src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,16 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Th
InlinedCallFrame *pInlinedCallFrame = dac_cast<PTR_InlinedCallFrame>(pFrame);
PTR_PInvokeMethodDesc pMD = pInlinedCallFrame->m_Datum;
TADDR datum = dac_cast<TADDR>(pMD);
#ifdef TARGET_64BIT
// On 64-bit platforms, an unmanaged calli target is encoded as (target << 1) | 1,
// so bit 0 must be checked first to distinguish it from a MethodDesc pointer with
// the InlinedCallFrameMarker::ExceptionHandlingHelper bit set. Otherwise, an odd
// calli target's shifted-in low bit can be misread as the marker.
if ((datum & 0x1) == 0 &&
(datum & (TADDR)InlinedCallFrameMarker::Mask) == (TADDR)InlinedCallFrameMarker::ExceptionHandlingHelper)
Comment thread
jkotas marked this conversation as resolved.
#else
if ((datum & (TADDR)InlinedCallFrameMarker::Mask) == (TADDR)InlinedCallFrameMarker::ExceptionHandlingHelper)
#endif // TARGET_64BIT
{
pFrame = pFrame->Next();
continue;
Expand Down Expand Up @@ -547,7 +556,16 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thr
InlinedCallFrame *pInlinedCallFrame = dac_cast<PTR_InlinedCallFrame>(pFrame);
PTR_PInvokeMethodDesc pMD = pInlinedCallFrame->m_Datum;
TADDR datum = dac_cast<TADDR>(pMD);
#ifdef TARGET_64BIT
// On 64-bit platforms, an unmanaged calli target is encoded as (target << 1) | 1,
// so bit 0 must be checked first to distinguish it from a MethodDesc pointer with
// the InlinedCallFrameMarker::ExceptionHandlingHelper bit set. Otherwise, an odd
// calli target's shifted-in low bit can be misread as the marker.
if ((datum & 0x1) == 0 &&
(datum & (TADDR)InlinedCallFrameMarker::Mask) == (TADDR)InlinedCallFrameMarker::ExceptionHandlingHelper)
#else
if ((datum & (TADDR)InlinedCallFrameMarker::Mask) == (TADDR)InlinedCallFrameMarker::ExceptionHandlingHelper)
#endif // TARGET_64BIT
{
pFrame = pFrame->Next();
continue;
Expand Down
Loading