@@ -8276,6 +8276,7 @@ ibf_load_alloc(const struct ibf_load *load, ibf_offset_t offset, int size)
8276
8276
#define IBF_WV (variable ) ibf_dump_write(dump, &(variable), sizeof(variable))
8277
8277
#define IBF_WP (b , type , n ) ibf_dump_write(dump, (b), sizeof(type) * (n))
8278
8278
#define IBF_R (val , type , n ) (type *)ibf_load_alloc(load, IBF_OFFSET(val), sizeof(type) * (n))
8279
+ #define IBF_ZERO (variable ) memset(&(variable), 0, sizeof(variable))
8279
8280
8280
8281
static int
8281
8282
ibf_table_lookup (struct st_table * table , st_data_t key )
@@ -9121,6 +9122,7 @@ ibf_dump_object_regexp(struct ibf_dump *dump, VALUE obj)
9121
9122
{
9122
9123
struct ibf_object_regexp regexp ;
9123
9124
VALUE srcstr = RREGEXP_SRC (obj );
9125
+ IBF_ZERO (regexp );
9124
9126
regexp .option = (char )rb_reg_options (obj );
9125
9127
regexp .srcstr = (long )ibf_dump_object (dump , srcstr );
9126
9128
IBF_WV (regexp );
@@ -9212,6 +9214,7 @@ ibf_dump_object_struct(struct ibf_dump *dump, VALUE obj)
9212
9214
if (rb_obj_is_kind_of (obj , rb_cRange )) {
9213
9215
struct ibf_object_struct_range range ;
9214
9216
VALUE beg , end ;
9217
+ IBF_ZERO (range );
9215
9218
range .len = 3 ;
9216
9219
range .class_index = 0 ;
9217
9220
@@ -9272,7 +9275,7 @@ ibf_dump_object_data(struct ibf_dump *dump, VALUE obj)
9272
9275
long len = strlen (name ) + 1 ;
9273
9276
IBF_WV (type );
9274
9277
IBF_WV (len );
9275
- IBF_WP (name , char , strlen ( name ) + 1 );
9278
+ IBF_WP (name , char , len );
9276
9279
}
9277
9280
else {
9278
9281
ibf_dump_object_unsupported (dump , obj );
@@ -9380,6 +9383,7 @@ ibf_dump_object_object(struct ibf_dump *dump, VALUE obj)
9380
9383
{
9381
9384
struct ibf_object_header obj_header ;
9382
9385
ibf_offset_t current_offset = ibf_dump_pos (dump );
9386
+ IBF_ZERO (obj_header );
9383
9387
obj_header .type = TYPE (obj );
9384
9388
9385
9389
if (SPECIAL_CONST_P (obj )) {
0 commit comments