diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-09-21 02:47:41 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-09-21 02:47:41 +0300 |
commit | ec72b969427ef3273dca85f0d06dc0f69476a026 (patch) | |
tree | 95e700e7edb9ea173dc5c59014cb145f9e3592fc /src/Native/Runtime/amd64 | |
parent | ac5f0b5df3d310e50724895c59881b6d8a548be1 (diff) |
Fix Unix hardware exception handling (#1889)
The RhpThrowHwEx was missing stack alignment and so when a hardware exception occured
at place where the stack was not aligned properly, the exception handling failed
later in FindProcInfo that uses aligned xmm writes to stack locals.
Diffstat (limited to 'src/Native/Runtime/amd64')
-rw-r--r-- | src/Native/Runtime/amd64/ExceptionHandling.S | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Native/Runtime/amd64/ExceptionHandling.S b/src/Native/Runtime/amd64/ExceptionHandling.S index 3e6a689b1..3c0f62595 100644 --- a/src/Native/Runtime/amd64/ExceptionHandling.S +++ b/src/Native/Runtime/amd64/ExceptionHandling.S @@ -23,6 +23,9 @@ NESTED_ENTRY RhpThrowHwEx, _TEXT, NoHandler mov rax, rsp // save the faulting RSP + // Align the stack towards zero + and rsp, -16 + add rsi, 1 // 'faulting IP' += 1, we do this because everywhere else we treat the faulting IP as // a return-address and optionally subtract one when doing EH-related things (but not // subtracting 1 when doing GC-related things). The fault IP here will be the start @@ -32,7 +35,6 @@ NESTED_ENTRY RhpThrowHwEx, _TEXT, NoHandler // don't need to be precise here because the fault location isn't a GC safe point xor rdx, rdx - push_register rdx // padding // struct PAL_LIMITED_CONTEXT // { |