1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

variable.c (struct gen_ivtbl): Use FLEX_ARY_LEN.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2018-01-13 12:17:42 +00:00
parent 2768bae806
commit ccc5c73258

View file

@ -34,7 +34,7 @@ static st_table *generic_iv_tbl_compat;
/* per-object */
struct gen_ivtbl {
uint32_t numiv;
VALUE ivptr[1]; /* flexible array */
VALUE ivptr[FLEX_ARY_LEN];
};
struct ivar_update {
@ -1001,7 +1001,7 @@ generic_ivar_get(VALUE obj, ID id, VALUE undef)
static size_t
gen_ivtbl_bytes(size_t n)
{
return sizeof(struct gen_ivtbl) + n * sizeof(VALUE) - sizeof(VALUE);
return sizeof(struct gen_ivtbl) + n * sizeof(VALUE);
}
static struct gen_ivtbl *