[x86/Linux] Fix framepointer while unwinding (#9678)
authorSaeHie Park <saehie.park@gmail.com>
Wed, 22 Feb 2017 00:26:21 +0000 (09:26 +0900)
committerJan Vorlicek <janvorli@microsoft.com>
Wed, 22 Feb 2017 00:26:21 +0000 (01:26 +0100)
Use pCallerContext when getting frame pointer

src/vm/eetwain.cpp

index 33ef29e56b7d399fcf560e8816fe760b15f8e6a9..bf6e1c7aa5d981b288d06588405536eb915c2f32 100644 (file)
@@ -5169,7 +5169,11 @@ OBJECTREF EECodeManager::GetInstance( PREGDISPLAY    pContext,
     if (info.ebpFrame)
     {
         _ASSERTE(stackDepth == 0);
-        taArgBase = *pContext->GetEbpLocation();
+#if defined(WIN64EXCEPTIONS)
+        taArgBase = GetCallerSp(pContext) - 2 * sizeof(TADDR);
+#else
+        taArgBase = *pContext->pEbp;
+#endif
     }
     else
     {
@@ -5340,7 +5344,11 @@ PTR_VOID EECodeManager::GetParamTypeArg(PREGDISPLAY     pContext,
         return NULL;
     }
 
+#if defined(WIN64EXCEPTIONS)
+    TADDR fp = GetCallerSp(pContext) - 2 * sizeof(TADDR);
+#else
     TADDR fp = GetRegdisplayFP(pContext);
+#endif
     TADDR taParamTypeArg = *PTR_TADDR(fp - GetParamTypeArgOffset(&info));
     return PTR_VOID(taParamTypeArg);