Skip to content
Merged
Prev Previous commit
Next Next commit
Fix Windows build
  • Loading branch information
AustinWise committed Jan 22, 2023
commit 12f2484e7ad7fd0d3f3c78e7cd456f2c7454ae0f
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ uintptr_t CoffNativeCodeManager::GetConservativeUpperBoundForOutgoingArgs(Method
}

bool CoffNativeCodeManager::UnwindStackFrame(MethodInfo * pMethodInfo,
uint32_t flags,
REGDISPLAY * pRegisterSet, // in/out
bool * pFoundReversePInvoke, // out
PInvokeTransitionFrame** ppPreviousTransitionFrame) // out
{
CoffNativeMethodInfo * pNativeMethodInfo = (CoffNativeMethodInfo *)pMethodInfo;
Expand All @@ -547,10 +549,13 @@ bool CoffNativeCodeManager::UnwindStackFrame(MethodInfo * pMethodInfo,

uint8_t unwindBlockFlags = *p++;

*pFoundReversePInvoke = (unwindBlockFlags & UBF_FUNC_REVERSE_PINVOKE) != 0;

if ((unwindBlockFlags & UBF_FUNC_HAS_ASSOCIATED_DATA) != 0)
p += sizeof(int32_t);

if ((unwindBlockFlags & UBF_FUNC_REVERSE_PINVOKE) != 0)
if ((unwindBlockFlags & UBF_FUNC_REVERSE_PINVOKE) != 0 &&
(flags & USFF_UsePreviousTransitionFrame) != 0)
{
// Reverse PInvoke transition should be on the main function body only
assert(pNativeMethodInfo->mainRuntimeFunction == pNativeMethodInfo->runtimeFunction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ class CoffNativeCodeManager : public ICodeManager
bool isActiveStackFrame);

bool UnwindStackFrame(MethodInfo * pMethodInfo,
uint32_t flags,
REGDISPLAY * pRegisterSet, // in/out
bool * pFoundReversePInvoke, // out
PInvokeTransitionFrame** ppPreviousTransitionFrame); // out

uintptr_t GetConservativeUpperBoundForOutgoingArgs(MethodInfo * pMethodInfo,
Expand Down