Skip to content

Commit

Permalink
fix addrmode assert (#84252)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Apr 4, 2023
1 parent a1954cc commit 149e43e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4472,7 +4472,10 @@ bool Compiler::gtMarkAddrMode(GenTree* addr, int* pCostEx, int* pCostSz, var_typ
op2op1->gtFlags |= GTF_ADDRMODE_NO_CSE;
op2op1 = op2op1->AsOp()->gtOp1;
}
assert(op1->gtEffectiveVal() == base);

// if genCreateAddrMode reported base as nullptr it means that op1 is effectively null address
assert((op1->gtEffectiveVal() == base) ||
(base == nullptr && op1->gtEffectiveVal()->IsIntegralConst(0)));
assert(op2op1 == idx);
}
}
Expand Down

0 comments on commit 149e43e

Please sign in to comment.