8276545: Fix handling of trap count overflow in Parse::Parse()

Reviewed-by: thartmann, kvn
This commit is contained in:
Dhamoder Nalla 2022-09-30 18:38:48 +00:00 committed by Vladimir Kozlov
parent 48674d4f36
commit da4e96d596

@ -469,8 +469,9 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses)
for (uint reason = 0; reason < md->trap_reason_limit(); reason++) {
uint md_count = md->trap_count(reason);
if (md_count != 0) {
if (md_count == md->trap_count_limit())
md_count += md->overflow_trap_count();
if (md_count >= md->trap_count_limit()) {
md_count = md->trap_count_limit() + md->overflow_trap_count();
}
uint total_count = C->trap_count(reason);
uint old_count = total_count;
total_count += md_count;