summaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-22 05:05:30 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-22 05:05:30 +0000
commit70fee5d1044cdef33723acc8490a27a7998792cc (patch)
treee5179d6189a9c4daedbe245e7d09f10147d26318 /array.c
parentc61c230e777841600ffa795854c535ff2eaee241 (diff)
downloadruby-70fee5d1044cdef33723acc8490a27a7998792cc.tar.gz
ruby-70fee5d1044cdef33723acc8490a27a7998792cc.tar.xz
ruby-70fee5d1044cdef33723acc8490a27a7998792cc.zip
* array.c (rb_ary_permutation): add volatile to avoid GC problem.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index 0afefb685..741887bcb 100644
--- a/array.c
+++ b/array.c
@@ -3069,9 +3069,9 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
}
}
else { /* this is the general case */
- VALUE t0 = tmpbuf(n,sizeof(long));
+ volatile VALUE t0 = tmpbuf(n,sizeof(long));
long *p = (long*)RSTRING_PTR(t0);
- VALUE t1 = tmpbuf(n,sizeof(int));
+ volatile VALUE t1 = tmpbuf(n,sizeof(int));
int *used = (int*)RSTRING_PTR(t1);
VALUE ary0 = ary_make_shared(ary); /* private defensive copy of ary */