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:
parent
8acaa122f5
commit
160d730ef4
2
gc.c
2
gc.c
@ -8464,7 +8464,7 @@ wmap_aset_update(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
|
|||||||
else {
|
else {
|
||||||
optr = 0;
|
optr = 0;
|
||||||
size = 1;
|
size = 1;
|
||||||
ptr = ruby_xmalloc2(2, sizeof(VALUE));
|
ptr = ruby_xmalloc0(2 * sizeof(VALUE));
|
||||||
}
|
}
|
||||||
ptr[0] = size;
|
ptr[0] = size;
|
||||||
ptr[size] = (VALUE)arg;
|
ptr[size] = (VALUE)arg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user