diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-12-08 18:56:56 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-12-08 18:56:56 +0300 |
commit | ab81581c85ccc14cdfed51aa5baf1f7fcab7f1b0 (patch) | |
tree | a81e22da117d106778e0881f89332e909a688efa /src/Native/Runtime/i386 | |
parent | cfe94d9a15ebbeebc77668f2a57fa5b47a6cbb49 (diff) |
This change fixes interface dispatch on ARM and x86 in case the _RhpCastableObjectDispatchHelper is jumped-to from RhpInterfaceDispatchX functions. The RhpInterfaceDispatchX were not preserving r12 on ARM / eax on x86 that contain the address of the indirection cell.
[tfs-changeset: 1640787]
Diffstat (limited to 'src/Native/Runtime/i386')
-rw-r--r-- | src/Native/Runtime/i386/StubDispatch.asm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Native/Runtime/i386/StubDispatch.asm b/src/Native/Runtime/i386/StubDispatch.asm index 775b26fe8..3f1bf106a 100644 --- a/src/Native/Runtime/i386/StubDispatch.asm +++ b/src/Native/Runtime/i386/StubDispatch.asm @@ -102,7 +102,13 @@ NextLabel textequ @CatStr( Attempt, %entry+1 ) cmp ebx, [eax + (OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 8))] jne @F pop ebx - jmp dword ptr [eax + (OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 8) + 4)] + ;; push the target address so that the following ret will jump to it and all registers will + ;; be in the same state as at the entry to _RhpInterfaceDispatch. + push dword ptr [eax + (OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 8) + 4)] + ;; eax currently contains the cache block. We need to point it back to the + ;; indirection cell using the back pointer in the cache block + mov eax, [eax + OFFSETOF__InterfaceDispatchCache__m_pCell] + ret @@: endm @@ -144,7 +150,7 @@ CurrentEntry = CurrentEntry + 1 mov eax, [eax + OFFSETOF__InterfaceDispatchCache__m_pCell] pop ebx jmp RhpInterfaceDispatchSlow - + StubName endp endm ;; DEFINE_INTERFACE_DISPATCH_STUB |