summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/enum.c b/enum.c
index cd4366281f..f561960dd6 100644
--- a/enum.c
+++ b/enum.c
@@ -846,8 +846,8 @@ enum_sort(VALUE obj)
#define SORT_BY_BUFSIZE 16
struct sort_by_data {
- VALUE ary;
- VALUE buf;
+ const VALUE ary;
+ const VALUE buf;
long n;
};
@@ -989,8 +989,8 @@ enum_sort_by(VALUE obj)
memo = MEMO_NEW(0, 0, 0);
OBJ_INFECT(memo, obj);
data = (struct sort_by_data *)&memo->v1;
- data->ary = ary;
- data->buf = buf;
+ RB_OBJ_WRITE(memo, &data->ary, ary);
+ RB_OBJ_WRITE(memo, &data->buf, buf);
data->n = 0;
rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
ary = data->ary;