From 6f690a5b01c3d438ba0a2a848a3909e43db650d8 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 6 Jun 2024 05:39:28 +0000 Subject: [PATCH] 8333177: Invalid value used for enum Cell in ciTypeFlow::get_start_state Reviewed-by: kvn, chagedorn --- src/hotspot/share/ci/ciTypeFlow.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/ci/ciTypeFlow.cpp b/src/hotspot/share/ci/ciTypeFlow.cpp index 7fec80cff40..520eeeb10d5 100644 --- a/src/hotspot/share/ci/ciTypeFlow.cpp +++ b/src/hotspot/share/ci/ciTypeFlow.cpp @@ -404,11 +404,9 @@ const ciTypeFlow::StateVector* ciTypeFlow::get_start_state() { state->push_translate(str.type()); } // Set the rest of the locals to bottom. - Cell cell = state->next_cell(state->tos()); - state->set_stack_size(0); - int limit = state->limit_cell(); - for (; cell < limit; cell = state->next_cell(cell)) { - state->set_type_at(cell, state->bottom_type()); + assert(state->stack_size() <= 0, "stack size should not be strictly positive"); + while (state->stack_size() < 0) { + state->push(state->bottom_type()); } // Lock an object, if necessary. state->set_monitor_count(method()->is_synchronized() ? 1 : 0);