From 949b94eabd74f2632c220b03f998a802032d2b82 Mon Sep 17 00:00:00 2001 From: Konstantin Baladurin Date: Thu, 25 Jan 2018 13:31:32 +0300 Subject: [x86/Linux] Fix HelperMethodFrame::UpdateRegDisplay (#15993) For DAC after initialization MachState using InsureInit method, register pointers are NULL so we cannot use them to restore register values. --- src/vm/i386/cgenx86.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/vm/i386/cgenx86.cpp b/src/vm/i386/cgenx86.cpp index 7071d27928..a43bc8558a 100644 --- a/src/vm/i386/cgenx86.cpp +++ b/src/vm/i386/cgenx86.cpp @@ -390,9 +390,11 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD) pRD->pCurrentContext->Eip = pRD->ControlPC = pUnwoundState->GetRetAddr(); pRD->pCurrentContext->Esp = pRD->SP = pUnwoundState->esp(); -#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContext->regname = *((DWORD*) pUnwoundState->p##regname()); - ENUM_CALLEE_SAVED_REGISTERS(); -#undef CALLEE_SAVED_REGISTER + // Do not use pUnwoundState->p##regname() here because it returns NULL in this case + pRD->pCurrentContext->Edi = pUnwoundState->_edi; + pRD->pCurrentContext->Esi = pUnwoundState->_esi; + pRD->pCurrentContext->Ebx = pUnwoundState->_ebx; + pRD->pCurrentContext->Ebp = pUnwoundState->_ebp; #define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = (DWORD*) pUnwoundState->p##regname(); ENUM_CALLEE_SAVED_REGISTERS(); -- cgit v1.2.3