We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e819ea commit 2bc47d3Copy full SHA for 2bc47d3
src/ssa.c
@@ -607,8 +607,11 @@ void solve_phi_insertion(void)
607
int work_list_idx = 0;
608
609
for (ref_block_t *ref = var->ref_block_list.head; ref;
610
- ref = ref->next)
+ ref = ref->next) {
611
+ if (work_list_idx >= 64) /* Prevent buffer overflow */
612
+ break;
613
work_list[work_list_idx++] = ref->bb;
614
+ }
615
616
for (int i = 0; i < work_list_idx; i++) {
617
basic_block_t *bb = work_list[i];
@@ -653,7 +656,7 @@ void solve_phi_insertion(void)
653
656
break;
654
657
}
655
658
- if (!found)
659
+ if (!found && work_list_idx < 64) /* Bounds check */
660
work_list[work_list_idx++] = df;
661
662
0 commit comments