Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Move GetUnwindInfo and GetNumberOfUnwindInfos into the real code header
Browse files Browse the repository at this point in the history
This commit fixes #8342.
  • Loading branch information
parjong committed Dec 20, 2016
1 parent 6677089 commit c2bad85
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions src/vm/codeman.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,40 @@ typedef struct _hpCodeHdr
}
#endif // !USE_INDIRECT_CODEHEADER

#if defined(WIN64EXCEPTIONS)
#ifdef USE_INDIRECT_CODEHEADER
typedef struct _hpRealCodeHdr ImplType;
typedef PTR_RealCodeHeader SelfType;
#else
typedef struct _hpCodeHdr ImplType;
typedef PTR_CodeHeader SelfType;
#endif

SelfType Self(void)
{
SUPPORTS_DAC;
return dac_cast<SelfType>(this);
}

UINT GetNumberOfUnwindInfos()
{
SUPPORTS_DAC;
return this->nUnwindInfos;
}
void SetNumberOfUnwindInfos(UINT nUnwindInfos)
{
LIMITED_METHOD_CONTRACT;
this->nUnwindInfos = nUnwindInfos;
}
PTR_RUNTIME_FUNCTION GetUnwindInfo(UINT iUnwindInfo)
{
SUPPORTS_DAC;
_ASSERTE(iUnwindInfo < GetNumberOfUnwindInfos());
return dac_cast<PTR_RUNTIME_FUNCTION>(
PTR_TO_MEMBER_TADDR(ImplType, Self(), unwindInfos) + iUnwindInfo * sizeof(T_RUNTIME_FUNCTION));
}
#endif // WIN64EXCEPTIONS

// if we're using the indirect codeheaders then all enumeration is done by the code header
#ifndef USE_INDIRECT_CODEHEADER
#ifdef DACCESS_COMPILE
Expand Down Expand Up @@ -324,20 +358,15 @@ typedef struct _hpCodeHdr
#if defined(WIN64EXCEPTIONS)
UINT GetNumberOfUnwindInfos()
{
SUPPORTS_DAC;
return pRealCodeHeader->nUnwindInfos;
return pRealCodeHeader->GetNumberOfUnwindInfos();
}
void SetNumberOfUnwindInfos(UINT nUnwindInfos)
{
LIMITED_METHOD_CONTRACT;
pRealCodeHeader->nUnwindInfos = nUnwindInfos;
pRealCodeHeader->SetNumberOfUnwindInfos(nUnwindInfos);
}
PTR_RUNTIME_FUNCTION GetUnwindInfo(UINT iUnwindInfo)
{
SUPPORTS_DAC;
_ASSERTE(iUnwindInfo < GetNumberOfUnwindInfos());
return dac_cast<PTR_RUNTIME_FUNCTION>(
PTR_TO_MEMBER_TADDR(RealCodeHeader, pRealCodeHeader, unwindInfos) + iUnwindInfo * sizeof(T_RUNTIME_FUNCTION));
return pRealCodeHeader->GetUnwindInfo(iUnwindInfo);
}
#endif // WIN64EXCEPTIONS

Expand Down

0 comments on commit c2bad85

Please sign in to comment.