Skip to content

Commit

Permalink
Fix ObjectAllocator assert (#79813)
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion authored Dec 19, 2022
1 parent 781fe41 commit c9175cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/coreclr/jit/objectalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,7 @@ void ObjectAllocator::RewriteUses()
Compiler::fgWalkResult PreOrderVisit(GenTree** use, GenTree* user)
{
GenTree* tree = *use;
assert(tree != nullptr);
assert(tree->IsLocal());
assert(tree->IsLocal() || tree->OperIsLocalAddr());

const unsigned int lclNum = tree->AsLclVarCommon()->GetLclNum();
unsigned int newLclNum = BAD_VAR_NUM;
Expand All @@ -849,6 +848,9 @@ void ObjectAllocator::RewriteUses()
if ((lclNum < BitVecTraits::GetSize(&m_allocator->m_bitVecTraits)) &&
m_allocator->MayLclVarPointToStack(lclNum))
{
// Analysis does not handle indirect access to pointer locals.
assert(tree->OperIs(GT_LCL_VAR));

var_types newType;
if (m_allocator->m_HeapLocalToStackLocalMap.TryGetValue(lclNum, &newLclNum))
{
Expand Down

0 comments on commit c9175cc

Please sign in to comment.