diff --git a/ChangeLog b/ChangeLog index 50be216f14..3519748307 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Dec 22 14:02:58 2007 Koichi Sasada + + * array.c (rb_ary_permutation): add volatile to avoid GC problem. + Sat Dec 22 11:47:42 2007 Koichi Sasada * eval.c (rb_obj_instance_eval): use class of immediate objects. diff --git a/array.c b/array.c index 0afefb685d..741887bcba 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 */