diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-22 05:05:30 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-22 05:05:30 +0000 |
commit | dd6ab4f3d5ba92c57d999f0ab4cbcb8c401af3d6 (patch) | |
tree | e5179d6189a9c4daedbe245e7d09f10147d26318 | |
parent | 3ce6e61a7bbe346e9cec0e88fb1a871000984cc9 (diff) | |
download | ruby-dd6ab4f3d5ba92c57d999f0ab4cbcb8c401af3d6.tar.gz |
* array.c (rb_ary_permutation): add volatile to avoid GC problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | array.c | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Sat Dec 22 14:02:58 2007 Koichi Sasada <ko1@atdot.net> + + * array.c (rb_ary_permutation): add volatile to avoid GC problem. + Sat Dec 22 11:47:42 2007 Koichi Sasada <ko1@atdot.net> * eval.c (rb_obj_instance_eval): use class of immediate objects. @@ -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 */ |