mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
check ar_table first.
RHASH_AR_TABLE_SIZE() has assertion that it is a ar_talbe.
The last commit breaks this assumption so check ar_table first.
(cherry picked from commit c3584dfacc)
This commit is contained in:
parent
ab6f78bc92
commit
897d4e31b0
1 changed files with 5 additions and 2 deletions
7
hash.c
7
hash.c
|
|
@ -747,11 +747,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue