mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-24 11:01:00 +01:00
BUILD: thread: silence a build warning when threads are disabled
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.
This commit is contained in:
parent
0de1e6180a
commit
1b536a11e7
@ -1261,7 +1261,9 @@ int thread_resolve_group_mask(struct thread_set *ts, int defgrp, char **err)
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user