Skip to content

Commit

Permalink
Use destType for size instead of srcType when writing a variable from…
Browse files Browse the repository at this point in the history
… a register to the stack.
  • Loading branch information
jkoritzinsky committed Dec 17, 2020
1 parent 87ae256 commit 380d7a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11836,10 +11836,10 @@ void CodeGen::genMultiRegStoreToLocal(GenTreeLclVar* lclNode)
regNumber varReg = lclNode->GetRegByIndex(i);
unsigned fieldLclNum = varDsc->lvFieldLclStart + i;
LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(fieldLclNum);
var_types destType = fieldVarDsc->TypeGet();
if (varReg != REG_NA)
{
var_types destType = fieldVarDsc->TypeGet();
hasRegs = true;
hasRegs = true;
if (varReg != reg)
{
// We may need a cross register-file copy here.
Expand All @@ -11855,7 +11855,7 @@ void CodeGen::genMultiRegStoreToLocal(GenTreeLclVar* lclNode)
{
if (!lclNode->AsLclVar()->IsLastUse(i))
{
GetEmitter()->emitIns_S_R(ins_Store(srcType), emitTypeSize(srcType), reg, fieldLclNum, 0);
GetEmitter()->emitIns_S_R(ins_Store(srcType), emitTypeSize(destType), reg, fieldLclNum, 0);
}
}
fieldVarDsc->SetRegNum(varReg);
Expand Down

0 comments on commit 380d7a2

Please sign in to comment.