Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsandreenko <seandree@microsoft.com>2017-01-14 04:59:20 +0300
committerJan Kotas <jkotas@microsoft.com>2017-01-14 04:59:20 +0300
commitcfe34d0303029908296d8d3e32ac0572c10d1db6 (patch)
treefa8f870a10bd2814277897f3dd2023045d04916c /src/Native/Runtime/windows
parentb71a9f8ff40b8065f7d0d254d6b0e2fae8f65ea2 (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.cpp18
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;
}