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
This commit is contained in:
nobu 2017-05-11 14:28:38 +00:00
parent 8acaa122f5
commit 160d730ef4

2
gc.c
View File

@ -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;