RHASH_AR_TABLE_SIZE() has assertion that it is a ar_talbe.
The last commit breaks this assumption so check ar_table first.
This commit is contained in:
Koichi Sasada 2020-03-07 03:55:54 +09:00
Родитель 4c019f5a62
Коммит c3584dfacc
1 изменённых файлов: 5 добавлений и 2 удалений

7
hash.c
Просмотреть файл

@ -763,11 +763,14 @@ ar_free_and_clear_table(VALUE hash)
static void
ar_try_convert_table(VALUE hash)
{
st_table *new_tab;
if (!RHASH_AR_TABLE_P(hash)) return;
const unsigned size = RHASH_AR_TABLE_SIZE(hash);
st_table *new_tab;
st_index_t i;
if (!RHASH_AR_TABLE_P(hash) || size < RHASH_AR_TABLE_MAX_SIZE) {
if (size < RHASH_AR_TABLE_MAX_SIZE) {
return;
}