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 | |
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.
-rw-r--r-- | src/Native/Runtime/amd64/ExceptionHandling.S | 4 | ||||
-rw-r--r-- | tests/src/Simple/Exceptions/no_unix | 1 |
2 files changed, 3 insertions, 2 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 // { diff --git a/tests/src/Simple/Exceptions/no_unix b/tests/src/Simple/Exceptions/no_unix deleted file mode 100644 index 9db98903a..000000000 --- a/tests/src/Simple/Exceptions/no_unix +++ /dev/null @@ -1 +0,0 @@ -Skip this test on unix |