From: Aditya Mandaleeka Date: Fri, 13 Apr 2018 12:25:39 +0000 (-0700) Subject: Preserve VASigCookieReg across PInvokeStubWorker call (#17521) X-Git-Tag: accepted/tizen/unified/20190422.045933~2341 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d81f619201a010fe92bcdaa0c09569f7390a69ae;p=platform%2Fupstream%2Fcoreclr.git 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. --- diff --git a/src/vm/arm64/PInvokeStubs.asm b/src/vm/arm64/PInvokeStubs.asm index 34d634a..afe2fb4 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