diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2017-04-05 17:45:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 17:45:55 +0200 |
commit | 557c314e9dd56bcab569c578ed445e47ae71c317 (patch) | |
tree | faa4ba890623805aa356978f9098d354c029988e /src/pal | |
parent | 93fd5fdf523df54945f36a1346e27dedbe1a2a4d (diff) | |
download | coreclr-557c314e9dd56bcab569c578ed445e47ae71c317.tar.gz coreclr-557c314e9dd56bcab569c578ed445e47ae71c317.tar.bz2 coreclr-557c314e9dd56bcab569c578ed445e47ae71c317.zip |
Fix ThrowExceptionFromContextInternal for x86 Linux (#10728)
The function was missing restoring of some callee saved registers
which caused crashes in Checked build and hang in Release build.
Diffstat (limited to 'src/pal')
-rw-r--r-- | src/pal/src/arch/i386/exceptionhelper.S | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/pal/src/arch/i386/exceptionhelper.S b/src/pal/src/arch/i386/exceptionhelper.S index f0bf8f8ef9..bf44124479 100644 --- a/src/pal/src/arch/i386/exceptionhelper.S +++ b/src/pal/src/arch/i386/exceptionhelper.S @@ -20,10 +20,13 @@ LEAF_ENTRY ThrowExceptionFromContextInternal, _TEXT push ebp mov ecx, [esp + 12] // ecx: PAL_SEHException * (first argument for ThrowExceptionHelper) - mov ebx, [esp + 8] // ebx: CONTEXT * + mov eax, [esp + 8] // ebx: CONTEXT * - mov ebp, [ebx + CONTEXT_Ebp] - mov esp, [ebx + CONTEXT_ResumeEsp] + mov ebp, [eax + CONTEXT_Ebp] + mov esp, [eax + CONTEXT_ResumeEsp] + mov ebx, [eax + CONTEXT_Ebx] + mov esi, [eax + CONTEXT_Esi] + mov edi, [eax + CONTEXT_Edi] // The ESP is re-initialized as the target frame's value, so the current function's // CFA is now right at the ESP. @@ -34,7 +37,8 @@ LEAF_ENTRY ThrowExceptionFromContextInternal, _TEXT .cfi_restore ebp // Store return address to the stack - mov ebx, [ebx + CONTEXT_Eip] - push ebx + mov eax, [eax + CONTEXT_Eip] + push eax jmp EXTERNAL_C_FUNC(ThrowExceptionHelper) + LEAF_END ThrowExceptionFromContextInternal, _TEXT |