diff --git a/compile.c b/compile.c index 3ab4aa81c6..cbde124516 100644 --- a/compile.c +++ b/compile.c @@ -2184,7 +2184,10 @@ iseq_set_local_table(rb_iseq_t *iseq, const rb_ast_id_table_t *tbl, const NODE * } if (size > 0) { - ID *ids = (ID *)ALLOC_N(ID, size); +#if SIZEOF_INT >= SIZEOF_SIZE_T + ASSUME(size < SIZE_MAX / sizeof(ID)); /* checked in xmalloc2_size */ +#endif + ID *ids = ALLOC_N(ID, size); MEMCPY(ids, tbl->ids + offset, ID, size); ISEQ_BODY(iseq)->local_table = ids; }