summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2017-04-05 17:45:55 +0200
committerGitHub <noreply@github.com>2017-04-05 17:45:55 +0200
commit557c314e9dd56bcab569c578ed445e47ae71c317 (patch)
treefaa4ba890623805aa356978f9098d354c029988e /src/pal
parent93fd5fdf523df54945f36a1346e27dedbe1a2a4d (diff)
downloadcoreclr-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.S14
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