8000 Fix MEMMOVE in rb_darray_insert · github/ruby@07e89bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 07e89bd

Browse files
committed
Fix MEMMOVE in rb_darray_insert
Ruby's MEMMOVE takes in the element data type for the third argument, not the size of the element. What this did was do sizeof(sizeof( ... )) which always returned sizeof(size_t).
1 parent 13e6fe9 commit 07e89bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

darray.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
MEMMOVE( \
5959
rb_darray_ref(*(ptr_to_ary), idx + 1), \
6060
rb_darray_ref(*(ptr_to_ary), idx), \
61-
sizeof((*(ptr_to_ary))->data[0]), \
61+
(*(ptr_to_ary))->data[0], \
6262
rb_darray_size(*(ptr_to_ary)) - idx); \
6363
rb_darray_set(*(ptr_to_ary), idx, element); \
6464
(*(ptr_to_ary))->meta.size++; \

0 commit comments

Comments
 (0)
0