Skip to content

Commit e4284b8

Browse files
authored
Make sure the offset matches (#71792)
1 parent 8a192f8 commit e4284b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/coreclr/jit/morph.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11376,8 +11376,9 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
1137611376
LclVarDsc* fieldVarDsc = lvaGetDesc(lclNumFld);
1137711377

1137811378
// Also make sure that the tree type matches the fieldVarType and that it's lvFldOffset
11379-
// is zero
11380-
if (fieldVarDsc->TypeGet() == typ && (fieldVarDsc->lvFldOffset == 0))
11379+
// is same as that of tree's offset.
11380+
if (fieldVarDsc->TypeGet() == typ &&
11381+
(fieldVarDsc->lvFldOffset == temp->AsLclVarCommon()->GetLclOffs()))
1138111382
{
1138211383
// We can just use the existing promoted field LclNum
1138311384
temp->AsLclVarCommon()->SetLclNum(lclNumFld);

0 commit comments

Comments
 (0)