summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonghyun Park <parjong@gmail.com>2017-04-04 15:50:02 +0700
committerJan Vorlicek <janvorli@microsoft.com>2017-04-04 10:50:02 +0200
commit53c88123a7f6216a31318f14062fd245730c74ba (patch)
treeb9ddb15c344e29cdbe2e12855104fe2dd9bacae3 /src
parentebf4927d891757b1bd7f54119de2ad60900d3232 (diff)
downloadcoreclr-53c88123a7f6216a31318f14062fd245730c74ba.tar.gz
coreclr-53c88123a7f6216a31318f14062fd245730c74ba.tar.bz2
coreclr-53c88123a7f6216a31318f14062fd245730c74ba.zip
[x86/Linux] Correctly unwind esp frames (#10685)
Diffstat (limited to 'src')
-rw-r--r--src/unwinder/i386/unwinder_i386.cpp2
-rw-r--r--src/vm/eetwain.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/unwinder/i386/unwinder_i386.cpp b/src/unwinder/i386/unwinder_i386.cpp
index 2c184d1e66..5ce6e16524 100644
--- a/src/unwinder/i386/unwinder_i386.cpp
+++ b/src/unwinder/i386/unwinder_i386.cpp
@@ -76,7 +76,7 @@ OOPStackUnwinderX86::VirtualUnwind(
FillRegDisplay(&rd, ContextRecord);
- rd.SP = ContextRecord->ResumeEsp;
+ rd.SP = ContextRecord->Esp;
rd.PCTAddr = (UINT_PTR)&(ContextRecord->Eip);
if (ContextPointers)
diff --git a/src/vm/eetwain.cpp b/src/vm/eetwain.cpp
index 18bc24ae39..a0d302cdb2 100644
--- a/src/vm/eetwain.cpp
+++ b/src/vm/eetwain.cpp
@@ -3815,7 +3815,10 @@ bool UnwindEbpDoubleAlignFrame(
// TODO Currently we assume that ESP of funclet frames is always fixed but actually it could change.
if (pCodeInfo->IsFunclet())
{
- baseSP = curESP + 12; // padding for 16byte stack alignment allocated in genFuncletProlog()
+ // Set baseSP as initial SP
+ baseSP = pContext->pCurrentContext->ResumeEsp;
+ // 16-byte stack alignment padding (allocated in genFuncletProlog)
+ baseSP += 12;
pContext->PCTAddr = baseSP;
pContext->ControlPC = *PTR_PCODE(pContext->PCTAddr);