From d81f619201a010fe92bcdaa0c09569f7390a69ae Mon Sep 17 00:00:00 2001 From: Aditya Mandaleeka Date: Fri, 13 Apr 2018 05:25:39 -0700 Subject: 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. --- src/vm/arm64/PInvokeStubs.asm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/vm') 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 -- cgit v1.2.3