8268369: SIGSEGV in PhaseCFG::implicit_null_check due to missing null check

Reviewed-by: chagedorn, kvn
This commit is contained in:
Tobias Hartmann 2021-07-06 05:44:59 +00:00
parent 5b8e1a266e
commit 4ad8b04421

@ -413,7 +413,7 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
// Move the control dependence if it is pinned to not-null block.
// Don't change it in other cases: NULL or dominating control.
Node* ctrl = best->in(0);
if (get_block_for_node(ctrl) == not_null_block) {
if (ctrl != NULL && get_block_for_node(ctrl) == not_null_block) {
// Set it to control edge of null check.
best->set_req(0, proj->in(0)->in(0));
}