summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--random.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3479fba..ef59c29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 7 13:20:12 2013 Koichi Sasada <ko1@atdot.net>
+
+ * random.c (random_load): use RARRAY_RAWPTR() instead of
+ RARRAY_PTR() because there is no new reference.
+
Wed Aug 7 12:58:23 2013 Koichi Sasada <ko1@atdot.net>
* thread.c (thread_start_func_2): use RARRAY_RAWPTR() instead of
diff --git a/random.c b/random.c
index 5d5a507..6a42e24 100644
--- a/random.c
+++ b/random.c
@@ -627,12 +627,12 @@ random_load(VALUE obj, VALUE dump)
rb_random_t *rnd = get_rnd(obj);
struct MT *mt = &rnd->mt;
VALUE state, left = INT2FIX(1), seed = INT2FIX(0);
- VALUE *ary;
+ const VALUE *ary;
unsigned long x;
rb_check_copyable(obj, dump);
Check_Type(dump, T_ARRAY);
- ary = RARRAY_PTR(dump);
+ ary = RARRAY_RAWPTR(dump);
switch (RARRAY_LEN(dump)) {
case 3:
seed = ary[2];