From 6fd392725273e3864aea5e4561889d1fb58bd934 Mon Sep 17 00:00:00 2001 From: vsadov <8218165+VSadov@users.noreply.github.com> Date: Thu, 1 Aug 2024 23:46:15 -0700 Subject: [PATCH] keep existing code for x86 --- src/coreclr/jit/codegenxarch.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/codegenxarch.cpp b/src/coreclr/jit/codegenxarch.cpp index f6878beaf09743..3b144b7fef05a5 100644 --- a/src/coreclr/jit/codegenxarch.cpp +++ b/src/coreclr/jit/codegenxarch.cpp @@ -113,13 +113,13 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg) } else { - if (compiler->info.compRetNativeType == TYP_REF) - { - gcInfo.gcRegGCrefSetCur |= RBM_INTRET; - } - else if (compiler->info.compRetNativeType == TYP_BYREF) + ReturnTypeDesc retTypeDesc = compiler->compRetTypeDesc; + const unsigned regCount = retTypeDesc.GetReturnRegCount(); + + for (unsigned i = 0; i < regCount; ++i) { - gcInfo.gcRegByrefSetCur |= RBM_INTRET; + gcInfo.gcMarkRegPtrVal(retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv), + retTypeDesc.GetReturnRegType(i)); } } }