Skip to content

Commit cdfd731

Browse files
Allow null-based ARR_ADDRs (#67486)
We can sometimes see trees like "ARR_ADDR(long 0)" that are the result of morph's folding logic. In general it does not seem great to allow folding of BYREFs into LONGs like that, but it is also not incorrect per-se.
1 parent 041933f commit cdfd731

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/jit/gentree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5788,7 +5788,7 @@ struct GenTreeArrAddr : GenTreeUnOp
57885788
, m_elemType(elemType)
57895789
, m_firstElemOffset(firstElemOffset)
57905790
{
5791-
assert(addr->TypeIs(TYP_BYREF));
5791+
assert(addr->TypeIs(TYP_BYREF) || addr->IsIntegralConst(0));
57925792
assert(((elemType == TYP_STRUCT) && (elemClassHandle != NO_CLASS_HANDLE)) ||
57935793
(elemClassHandle == NO_CLASS_HANDLE));
57945794

0 commit comments

Comments
 (0)