Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

Commit

Permalink
8258790: C2: Crash on empty macro node list
Browse files Browse the repository at this point in the history
Reviewed-by: kvn, chagedorn
  • Loading branch information
Vladimir Ivanov committed Dec 22, 2020
1 parent 8da7c58 commit 772addf
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/hotspot/share/opto/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2563,11 +2563,8 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
bool progress = true;
while (progress) {
progress = false;
for (int i = C->macro_count(); i > 0; i--) {
if (i > C->macro_count()) {
i = C->macro_count(); // more than 1 element can be eliminated at once
}
Node* n = C->macro_node(i-1);
for (int i = C->macro_count(); i > 0; i = MIN2(i - 1, C->macro_count())) { // more than 1 element can be eliminated at once
Node* n = C->macro_node(i - 1);
bool success = false;
DEBUG_ONLY(int old_macro_count = C->macro_count();)
if (n->is_AbstractLock()) {
Expand All @@ -2582,11 +2579,8 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
progress = true;
while (progress) {
progress = false;
for (int i = C->macro_count(); i > 0; i--) {
if (i > C->macro_count()) {
i = C->macro_count(); // more than 1 element can be eliminated at once
}
Node* n = C->macro_node(i-1);
for (int i = C->macro_count(); i > 0; i = MIN2(i - 1, C->macro_count())) { // more than 1 element can be eliminated at once
Node* n = C->macro_node(i - 1);
bool success = false;
DEBUG_ONLY(int old_macro_count = C->macro_count();)
switch (n->class_id()) {
Expand Down

1 comment on commit 772addf

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.