diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-11 14:28:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-11 14:28:38 +0000 |
commit | 4fe9df3d6591e0179dce7873eadbcc446005f72a (patch) | |
tree | 77e16eb77d4aaa723b6e3ea221c627b2b5e4e768 /gc.c | |
parent | 3f7284fe95217ef5da0b58ed0dd86691082424ad (diff) | |
download | ruby-4fe9df3d6591e0179dce7873eadbcc446005f72a.tar.gz |
gc.c: skip unnecessary check
* gc.c (wmap_aset): skip unnecessary size check.
`2*sizeof(VALUE)` is static and should never overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -8464,7 +8464,7 @@ wmap_aset_update(st_data_t *key, st_data_t *val, st_data_t arg, int existing) else { optr = 0; size = 1; - ptr = ruby_xmalloc2(2, sizeof(VALUE)); + ptr = ruby_xmalloc0(2 * sizeof(VALUE)); } ptr[0] = size; ptr[size] = (VALUE)arg; |