iv_index_tbl_newsize() usually returns iv_index_tbl->num_entries
because ivup->iv_extended is usually false.
This commit is contained in:
Koichi Sasada 2020-11-10 10:44:45 +09:00
Родитель 2fed5f0ad8
Коммит b557c5768c
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -1038,13 +1038,13 @@ gen_ivtbl_dup(const struct gen_ivtbl *orig)
static uint32_t static uint32_t
iv_index_tbl_newsize(struct ivar_update *ivup) iv_index_tbl_newsize(struct ivar_update *ivup)
{ {
uint32_t index = (uint32_t)ivup->index; /* should not overflow */
uint32_t newsize = (index+1) + (index+1)/4; /* (index+1)*1.25 */
if (!ivup->iv_extended) { if (!ivup->iv_extended) {
newsize = (uint32_t)ivup->u.iv_index_tbl->num_entries; return (uint32_t)ivup->u.iv_index_tbl->num_entries;
}
else {
uint32_t index = (uint32_t)ivup->index; /* should not overflow */
return (index+1) + (index+1)/4; /* (index+1)*1.25 */
} }
return newsize;
} }
static int static int