8258790: C2: Crash on empty macro node list
Reviewed-by: kvn, chagedorn
This commit is contained in:
parent
8da7c58016
commit
772addfd24
@ -2563,11 +2563,8 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
|
|||||||
bool progress = true;
|
bool progress = true;
|
||||||
while (progress) {
|
while (progress) {
|
||||||
progress = false;
|
progress = false;
|
||||||
for (int i = C->macro_count(); i > 0; i--) {
|
for (int i = C->macro_count(); i > 0; i = MIN2(i - 1, C->macro_count())) { // more than 1 element can be eliminated at once
|
||||||
if (i > C->macro_count()) {
|
Node* n = C->macro_node(i - 1);
|
||||||
i = C->macro_count(); // more than 1 element can be eliminated at once
|
|
||||||
}
|
|
||||||
Node* n = C->macro_node(i-1);
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
DEBUG_ONLY(int old_macro_count = C->macro_count();)
|
DEBUG_ONLY(int old_macro_count = C->macro_count();)
|
||||||
if (n->is_AbstractLock()) {
|
if (n->is_AbstractLock()) {
|
||||||
@ -2582,11 +2579,8 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
|
|||||||
progress = true;
|
progress = true;
|
||||||
while (progress) {
|
while (progress) {
|
||||||
progress = false;
|
progress = false;
|
||||||
for (int i = C->macro_count(); i > 0; i--) {
|
for (int i = C->macro_count(); i > 0; i = MIN2(i - 1, C->macro_count())) { // more than 1 element can be eliminated at once
|
||||||
if (i > C->macro_count()) {
|
Node* n = C->macro_node(i - 1);
|
||||||
i = C->macro_count(); // more than 1 element can be eliminated at once
|
|
||||||
}
|
|
||||||
Node* n = C->macro_node(i-1);
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
DEBUG_ONLY(int old_macro_count = C->macro_count();)
|
DEBUG_ONLY(int old_macro_count = C->macro_count();)
|
||||||
switch (n->class_id()) {
|
switch (n->class_id()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user