JIT: fix gc type for PUTARG_SPLIT codegen (#57099)
authorAndy Ayers <andya@microsoft.com>
Tue, 10 Aug 2021 18:41:13 +0000 (11:41 -0700)
committerGitHub <noreply@github.com>
Tue, 10 Aug 2021 18:41:13 +0000 (11:41 -0700)
If we need to swap registers during codegen for PUTARG_SPLIT, make sure
we use the right GC type.

Fixes #13127.

src/coreclr/jit/codegenarmarch.cpp

index 99095adbc6f6d6d6473151660bc48cee50cb7df1..ccdd576a7520669ddb6aedb7f6ddf1d1cea251e0 100644 (file)
@@ -1336,7 +1336,8 @@ void CodeGen::genPutArgSplit(GenTreePutArgSplit* treeNode)
                 if (targetReg == addrReg && idx != treeNode->gtNumRegs - 1)
                 {
                     assert(targetReg != baseReg);
-                    emit->emitIns_Mov(INS_mov, emitActualTypeSize(type), baseReg, addrReg, /* canSkip */ false);
+                    var_types addrType = addrNode->TypeGet();
+                    emit->emitIns_Mov(INS_mov, emitActualTypeSize(addrType), baseReg, addrReg, /* canSkip */ false);
                     addrReg = baseReg;
                 }