diff --git a/src/coreclr/jit/codegenloongarch64.cpp b/src/coreclr/jit/codegenloongarch64.cpp index 33bd2a77486c6..bdef67f16595e 100644 --- a/src/coreclr/jit/codegenloongarch64.cpp +++ b/src/coreclr/jit/codegenloongarch64.cpp @@ -8625,6 +8625,7 @@ void CodeGen::genFnPrologCalleeRegArgs() (regNumber)regArg[i]); regArgNum--; regArgMaskLive &= ~genRegMask((regNumber)regArg[j]); + regArg[j] = 0; if (regArgNum == 0) { break; diff --git a/src/coreclr/jit/codegenriscv64.cpp b/src/coreclr/jit/codegenriscv64.cpp index 4b9c4119854cd..d4bd4dcab9b6d 100644 --- a/src/coreclr/jit/codegenriscv64.cpp +++ b/src/coreclr/jit/codegenriscv64.cpp @@ -7960,6 +7960,7 @@ void CodeGen::genFnPrologCalleeRegArgs() 0); regArgNum--; regArgMaskLive &= ~genRegMask((regNumber)regArg[j]); + regArg[j] = 0; } else if (k == i) { @@ -8037,6 +8038,7 @@ void CodeGen::genFnPrologCalleeRegArgs() (regNumber)regArg[i], (regNumber)regArg[i]); regArgNum--; regArgMaskLive &= ~genRegMask((regNumber)regArg[j]); + regArg[j] = 0; if (regArgNum == 0) { break;