Skip to content

Commit

Permalink
Allow null-based ARR_ADDRs (#67486)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SingleAccretion authored Apr 3, 2022
1 parent 041933f commit cdfd731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -5788,7 +5788,7 @@ struct GenTreeArrAddr : GenTreeUnOp
, m_elemType(elemType)
, m_firstElemOffset(firstElemOffset)
{
assert(addr->TypeIs(TYP_BYREF));
assert(addr->TypeIs(TYP_BYREF) || addr->IsIntegralConst(0));
assert(((elemType == TYP_STRUCT) && (elemClassHandle != NO_CLASS_HANDLE)) ||
(elemClassHandle == NO_CLASS_HANDLE));

Expand Down

0 comments on commit cdfd731

Please sign in to comment.