Commit e13661a0 authored by simonmar@microsoft.com's avatar simonmar@microsoft.com
Browse files

fix boundary bugs in a couple of for-loops

parent 8db56c86
...@@ -1409,8 +1409,8 @@ scavenge_find_global_work (void) ...@@ -1409,8 +1409,8 @@ scavenge_find_global_work (void)
step_workspace *ws; step_workspace *ws;
flag = rtsFalse; flag = rtsFalse;
for (g = RtsFlags.GcFlags.generations; --g >= 0; ) { for (g = RtsFlags.GcFlags.generations-1; g >= 0; g--) {
for (s = generations[g].n_steps; --s >= 0; ) { for (s = generations[g].n_steps-1; s >= 0; s--) {
if (g == 0 && s == 0 && RtsFlags.GcFlags.generations > 1) { if (g == 0 && s == 0 && RtsFlags.GcFlags.generations > 1) {
continue; continue;
} }
...@@ -1568,8 +1568,8 @@ any_work (void) ...@@ -1568,8 +1568,8 @@ any_work (void)
// Check for global work in any step. We don't need to check for // Check for global work in any step. We don't need to check for
// local work, because we have already exited scavenge_loop(), // local work, because we have already exited scavenge_loop(),
// which means there is no local work for this thread. // which means there is no local work for this thread.
for (g = RtsFlags.GcFlags.generations; --g >= 0; ) { for (g = RtsFlags.GcFlags.generations-1; g >= 0; g--) {
for (s = generations[g].n_steps; --s >= 0; ) { for (s = generations[g].n_steps-1; s >= 0; s--) {
if (g == 0 && s == 0 && RtsFlags.GcFlags.generations > 1) { if (g == 0 && s == 0 && RtsFlags.GcFlags.generations > 1) {
continue; continue;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment