summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityamandaleeka@users.noreply.github.com>2018-04-13 05:25:39 -0700
committerJan Kotas <jkotas@microsoft.com>2018-04-13 05:25:39 -0700
commitd81f619201a010fe92bcdaa0c09569f7390a69ae (patch)
treecbc47f5889d13a6dafe8e7659f748c72d60b3672 /src/vm
parentcae5bb17b1abb96758c17aa53ca3d6988c3179ef (diff)
downloadcoreclr-d81f619201a010fe92bcdaa0c09569f7390a69ae.tar.gz
coreclr-d81f619201a010fe92bcdaa0c09569f7390a69ae.tar.bz2
coreclr-d81f619201a010fe92bcdaa0c09569f7390a69ae.zip
Preserve VASigCookieReg across PInvokeStubWorker call (#17521)
The call to PInvokeStubWorker can do all kinds of stuff to the VASigCookieReg in the GenericPInvokeCalli case, since x15 is just a temporary register. Let's save it in a callee-saved register so that when we come back after stub generation, we still have the correct value for the VASigCookie.
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/arm64/PInvokeStubs.asm10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vm/arm64/PInvokeStubs.asm b/src/vm/arm64/PInvokeStubs.asm
index 34d634ab27..afe2fb4ec8 100644
--- a/src/vm/arm64/PInvokeStubs.asm
+++ b/src/vm/arm64/PInvokeStubs.asm
@@ -80,15 +80,21 @@ __PInvokeGenStubFuncName SETS "$__PInvokeGenStubFuncName":CC:"_RetBuffArg"
ENDIF
; x0 = pTransitionBlock
- add x0, sp, #__PWTB_TransitionBlock
+ add x0, sp, #__PWTB_TransitionBlock
; save hidden arg
mov x19, $HiddenArg
+ ; save VASigCookieReg
+ mov x20, $VASigCookieReg
+
bl $__PInvokeStubWorkerName
+ ; restore VASigCookieReg
+ mov $VASigCookieReg, x20
+
; restore hidden arg (method desc or unmanaged target)
- mov $HiddenArg , x19
+ mov $HiddenArg, x19
EPILOG_WITH_TRANSITION_BLOCK_TAILCALL