Commit fbdc187 Vladimir Ivanov
committed Dec 4, 2020
1 parent fd6756e commit fbdc187 Copy full SHA for fbdc187
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2564,7 +2564,10 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
2564
2564
while (progress) {
2565
2565
progress = false ;
2566
2566
for (int i = C->macro_count (); i > 0 ; i--) {
2567
- Node * n = C->macro_node (i-1 );
2567
+ if (i > C->macro_count ()) {
2568
+ i = C->macro_count (); // more than 1 element can be eliminated at once
2569
+ }
2570
+ Node* n = C->macro_node (i-1 );
2568
2571
bool success = false ;
2569
2572
DEBUG_ONLY (int old_macro_count = C->macro_count ();)
2570
2573
if (n->is_AbstractLock ()) {
@@ -2580,7 +2583,10 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
2580
2583
while (progress) {
2581
2584
progress = false ;
2582
2585
for (int i = C->macro_count (); i > 0 ; i--) {
2583
- Node * n = C->macro_node (i-1 );
2586
+ if (i > C->macro_count ()) {
2587
+ i = C->macro_count (); // more than 1 element can be eliminated at once
2588
+ }
2589
+ Node* n = C->macro_node (i-1 );
2584
2590
bool success = false ;
2585
2591
DEBUG_ONLY (int old_macro_count = C->macro_count ();)
2586
2592
switch (n->class_id ()) {
You can’t perform that action at this time.
0 commit comments