From ccc5c7325850e9306ce45484892ded796603be4c Mon Sep 17 00:00:00 2001 From: mame Date: Sat, 13 Jan 2018 12:17:42 +0000 Subject: [PATCH] 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 --- variable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variable.c b/variable.c index 51891e235d..836686316f 100644 --- a/variable.c +++ b/variable.c @@ -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 *