Suppress overflow warning at ALLOC_N
in iseq_set_local_table
`xmalloc2` checks the overflow of arguments multiplication.
This commit is contained in:
parent
c5f7d274d7
commit
7ddc5e6187
Notes:
git
2025-06-04 07:38:10 +00:00
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user