diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-12 03:45:15 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-12 03:45:15 +0000 |
commit | 91cb5c1a70b2f659b6ee1dad4ca7c658fe1e00f9 (patch) | |
tree | 2ce8c94c7cacb27eb5044f36c736246f31fb9d8a /gc.c | |
parent | 9653f770ae359800dcd53b037fad5c07988717c2 (diff) |
fix empty Hash memsize.
* gc.c (obj_memsize_of): ar_table ptr can be NULL (size == 0).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -3356,8 +3356,10 @@ obj_memsize_of(VALUE obj, int use_all_types) break; case T_HASH: if (RHASH_AR_TABLE_P(obj)) { - size_t rb_hash_ar_table_size(); - size += rb_hash_ar_table_size(); + if (RHASH_AR_TABLE(obj) != NULL) { + size_t rb_hash_ar_table_size(); + size += rb_hash_ar_table_size(); + } } else { VM_ASSERT(RHASH_ST_TABLE(obj) != NULL); |