Skip to content

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
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

0 comments on commit 772addf

Please sign in to comment.