Merge pull request #3914 from ntherning/mono_context_get_current-on-windows-does...
authorNiklas Therning <niklas@therning.org>
Tue, 8 Nov 2016 17:52:55 +0000 (18:52 +0100)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2016 17:52:55 +0000 (18:52 +0100)
mono_context_get_current() on Windows stores registers at incorrect indexes

mono/utils/win64.asm

index 15984b6c059dfdabc3d03ba6f7f91df67ab3bc06..1ac7e077af462557f02a22fb47bf04a457638998 100644 (file)
@@ -13,13 +13,13 @@ ifdef RAX
 PUBLIC mono_context_get_current
 
 mono_context_get_current PROC
-;rdi has the ctx ptr
+;rcx has the ctx ptr
        mov [rcx + 00h], rax
-       mov [rcx + 08h], rbx
-       mov [rcx + 10h], rcx
-       mov [rcx + 18h], rdx
-       mov [rcx + 20h], rbp
-       mov [rcx + 28h], rsp
+       mov [rcx + 08h], rcx
+       mov [rcx + 10h], rdx
+       mov [rcx + 18h], rbx
+       mov [rcx + 20h], rsp
+       mov [rcx + 28h], rbp
        mov [rcx + 30h], rsi
        mov [rcx + 38h], rdi
        mov [rcx + 40h], r8