Skip to content

Commit

Permalink
Make compCurBB available for fgMorphBlockReturn.
Browse files Browse the repository at this point in the history
When we generate an asignment we could need to create a new assertion, that requires `compCurBB` to be available.
  • Loading branch information
Sergey Andreenko committed Mar 27, 2020
1 parent 315288b commit 8347f1c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/coreclr/src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15467,10 +15467,6 @@ void Compiler::fgMorphStmts(BasicBlock* block, bool* lnot, bool* loadw)
{
fgRemoveRestOfBlock = false;

/* Make the current basic block address available globally */

compCurBB = block;

*lnot = *loadw = false;

fgCurrentlyInUseArgTemps = hashBv::Create(this);
Expand Down Expand Up @@ -15668,10 +15664,6 @@ void Compiler::fgMorphStmts(BasicBlock* block, bool* lnot, bool* loadw)
}
#endif

#ifdef DEBUG
compCurBB = (BasicBlock*)INVALID_POINTER_VALUE;
#endif

// Reset this back so that it doesn't leak out impacting other blocks
fgRemoveRestOfBlock = false;
}
Expand Down Expand Up @@ -15754,6 +15746,8 @@ void Compiler::fgMorphBlocks()
optAssertionReset(0);
}
#endif
// Make the current basic block address available globally.
compCurBB = block;

// Process all statement trees in the basic block.
fgMorphStmts(block, &lnot, &loadw);
Expand All @@ -15766,12 +15760,13 @@ void Compiler::fgMorphBlocks()
fgMergeBlockReturn(block);
}
}
block = block->bbNext;
} while (block);

/* We are done with the global morphing phase */
block = block->bbNext;
} while (block != nullptr);

// We are done with the global morphing phase
fgGlobalMorph = false;
compCurBB = nullptr;

#ifdef DEBUG
if (verboseTrees)
Expand Down

0 comments on commit 8347f1c

Please sign in to comment.