8258790: C2: Crash on empty macro node list

Reviewed-by: kvn, chagedorn
This commit is contained in:
Vladimir Ivanov 2020-12-22 12:12:21 +00:00
parent 8da7c58016
commit 772addfd24

View File

@ -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()) {
@ -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()) {