summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-14 11:19:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-14 11:19:18 +0000
commit6b5e0bd98c3a807ab7708e775ac9b60a4f59e427 (patch)
tree5e86e7f6ac8258b53aaef567a416e7caac4fdd66 /iseq.c
parentbbea0270272720d6b97fa74cf59d20eee9519aa8 (diff)
exclude flexible array size with old compilers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index 57ff506d0a..20ad68e65e 100644
--- a/iseq.c
+++ b/iseq.c
@@ -208,7 +208,7 @@ iseq_memsize(const rb_iseq_t *iseq)
cur = compile_data->storage_head;
while (cur) {
- size += cur->size + sizeof(struct iseq_compile_data_storage);
+ size += cur->size + offsetof(struct iseq_compile_data_storage, buff);
cur = cur->next;
}
}
@@ -333,7 +333,7 @@ prepare_iseq_build(rb_iseq_t *iseq,
ISEQ_COMPILE_DATA(iseq)->storage_head = ISEQ_COMPILE_DATA(iseq)->storage_current =
(struct iseq_compile_data_storage *)
ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
- sizeof(struct iseq_compile_data_storage));
+ offsetof(struct iseq_compile_data_storage, buff));
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, rb_ary_tmp_new(3));
ISEQ_COMPILE_DATA(iseq)->storage_head->pos = 0;