Possible undefined behavior for bit shift in citus_stat_tenants.c

pull/7954/head
Maksim Melnikov 2025-04-07 15:09:57 +03:00
parent 8a8a493b67
commit 4fec8e2138
1 changed files with 2 additions and 1 deletions

View File

@ -609,6 +609,7 @@ ReduceScoreIfNecessary(TenantStats *tenantStats, TimestampTz queryTime)
if (periodCountAfterLastScoreReduction > 0)
{
tenantStats->lastScoreReduction = queryTime;
/*addtional check to avoid undefined behavior */
tenantStats->score = (periodCountAfterLastScoreReduction <
TENANTS_STATS_FIELD_BIT_LENGTH(tenantStats, score))