When threads are disabled, the compiler complains that we might be
accessing tg->abs[] out of bounds since the array is of size 1. It
cannot know that the condition to do this is never met, and given
that it's not in a fast path, we can make it more obvious.
uint base = ha_tgroup_info[g].base % LONGBITS;
mask = ts->abs[block] >> base;
- if (base && ha_tgroup_info[g].count > (LONGBITS - base))
+ if (base &&
+ (block + 1) < sizeof(ts->abs) / sizeof(ts->abs[0]) &&
+ ha_tgroup_info[g].count > (LONGBITS - base))
mask |= ts->abs[block + 1] << (LONGBITS - base);
mask &= nbits(ha_tgroup_info[g].count);
mask &= ha_tgroup_info[g].threads_enabled;