Skip to content

Commit

Permalink
call gtFoldExpr after fgMorphExpandInstanceField (dotnet#103648)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed Jun 19, 2024
1 parent 7441c8c commit 9c51d32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5110,6 +5110,12 @@ GenTree* Compiler::fgMorphExpandInstanceField(GenTree* tree, MorphAddrContext* m
{
addr->SetHasOrderingSideEffect();
}

if (addr->gtGetOp1()->OperIsConst() && addr->gtGetOp2()->OperIsConst())
{
// Fold it if we have const-handle + const-offset
addr = gtFoldExprConst(addr);
}
}

if (addExplicitNullCheck)
Expand Down

0 comments on commit 9c51d32

Please sign in to comment.