File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -6189,8 +6189,7 @@ struct GenTreeArrAddr : GenTreeUnOp
6189
6189
, m_elemType(elemType)
6190
6190
, m_firstElemOffset(firstElemOffset)
6191
6191
{
6192
- // Temporarily disable this assert. Tracking: https://github.com/dotnet/runtime/issues/67600
6193
- // assert(addr->TypeIs(TYP_BYREF) || addr->IsIntegralConst(0));
6192
+ assert (addr->TypeIs (TYP_BYREF));
6194
6193
assert (((elemType == TYP_STRUCT) && (elemClassHandle != NO_CLASS_HANDLE)) ||
6195
6194
(elemClassHandle == NO_CLASS_HANDLE));
6196
6195
Original file line number Diff line number Diff line change @@ -13074,9 +13074,8 @@ GenTree* Compiler::fgOptimizeAddition(GenTreeOp* add)
13074
13074
DEBUG_DESTROY_NODE(constTwo);
13075
13075
}
13076
13076
13077
- // Fold (x + 0) - given it won't change the tree type to TYP_REF.
13078
- // TODO-Bug: this code will lose the GC-ness of a tree like "native int + byref(0)".
13079
- if (op2->IsIntegralConst(0) && ((add->TypeGet() == op1->TypeGet()) || !op1->TypeIs(TYP_REF)))
13077
+ // Fold (x + 0) - given it won't change the tree type.
13078
+ if (op2->IsIntegralConst(0) && (genActualType(add) == genActualType(op1)))
13080
13079
{
13081
13080
if (op2->IsCnsIntOrI() && varTypeIsI(op1))
13082
13081
{
You can’t perform that action at this time.
0 commit comments