From d756174d7a5b847170ec87bcef1d4639e15ea013 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 30 Oct 2008 12:35:04 +0000 Subject: * array.c (rb_ary_permutation): hide temporal array. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'array.c') diff --git a/array.c b/array.c index ce11aa4b1..46d31ca4c 100644 --- a/array.c +++ b/array.c @@ -3463,12 +3463,14 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary) volatile VALUE t1 = tmpbuf(n,sizeof(int)); int *used = (int*)RSTRING_PTR(t1); VALUE ary0 = ary_make_substitution(ary); /* private defensive copy of ary */ + RBASIC(ary0)->klass = 0; for (i = 0; i < n; i++) used[i] = 0; /* initialize array */ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */ RB_GC_GUARD(t0); RB_GC_GUARD(t1); + RBASIC(ary0)->klass = rb_cArray; } return ary; } -- cgit