diff options
author | sandreenko <seandree@microsoft.com> | 2017-01-14 04:59:20 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-01-14 04:59:20 +0300 |
commit | cfe34d0303029908296d8d3e32ac0572c10d1db6 (patch) | |
tree | fa8f870a10bd2814277897f3dd2023045d04916c /src/Native/Runtime/windows | |
parent | b71a9f8ff40b8065f7d0d254d6b0e2fae8f65ea2 (diff) |
Encode Reverse PInvoke frame stack slot in GCInfo (#2484)
Fix #2115. Set ppPreviousTransitionFrame.
Diffstat (limited to 'src/Native/Runtime/windows')
-rw-r--r-- | src/Native/Runtime/windows/CoffNativeCodeManager.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Native/Runtime/windows/CoffNativeCodeManager.cpp b/src/Native/Runtime/windows/CoffNativeCodeManager.cpp index 6692d298b..076a57539 100644 --- a/src/Native/Runtime/windows/CoffNativeCodeManager.cpp +++ b/src/Native/Runtime/windows/CoffNativeCodeManager.cpp @@ -321,12 +321,20 @@ bool CoffNativeCodeManager::UnwindStackFrame(MethodInfo * pMethodInfo, p += sizeof(int32_t); GcInfoDecoder decoder(GCInfoToken(p), DECODE_REVERSE_PINVOKE_VAR); + INT32 slot = decoder.GetReversePInvokeFrameStackSlot(); + assert(slot != NO_REVERSE_PINVOKE_FRAME); - // @TODO: CORERT: Encode reverse PInvoke frame slot in GCInfo: https://github.com/dotnet/corert/issues/2115 - // INT32 slot = decoder.GetReversePInvokeFrameStackSlot(); - // assert(slot != NO_REVERSE_PINVOKE_FRAME); - - *ppPreviousTransitionFrame = (PTR_VOID)-1; + TADDR basePointer = NULL; + UINT32 stackBasedRegister = decoder.GetStackBaseRegister(); + if (stackBasedRegister == NO_STACK_BASE_REGISTER) + { + basePointer = dac_cast<TADDR>(pRegisterSet->GetSP()); + } + else + { + basePointer = dac_cast<TADDR>(pRegisterSet->GetFP()); + } + *ppPreviousTransitionFrame = *(void**)(basePointer + slot); return true; } |