mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix intermediate array off-by-one error
Co-authored-by: Adam Hess <HParker@github.com>
This commit is contained in:
parent
f77517f473
commit
30038656aa
Notes:
git
2024-10-04 19:04:43 +00:00
3 changed files with 53 additions and 5 deletions
|
@ -6797,6 +6797,8 @@ pm_compile_array_node(rb_iseq_t *iseq, const pm_node_t *node, const pm_node_list
|
|||
// Create the temporary array.
|
||||
for (; tmp_array_size; tmp_array_size--)
|
||||
rb_ary_push(tmp_array, pm_static_literal_value(iseq, elements->nodes[index++], scope_node));
|
||||
|
||||
index--; // about to be incremented by for loop
|
||||
OBJ_FREEZE(tmp_array);
|
||||
|
||||
// Emit the optimized code.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue