From bcfcbefc2665537f032f08a9ae4b373d1b325e1e Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 28 May 2010 08:51:41 +0000 Subject: * array.c (rb_ary_product): Use tmpary instead, to ensure marking arrays by GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index d17386a600..fb93a794a3 100644 --- a/array.c +++ b/array.c @@ -3683,9 +3683,9 @@ rb_ary_product(argc, argv, ary) VALUE ary; { int n = argc+1; /* How many arrays we're operating on */ - volatile VALUE t0 = tmpbuf(n, sizeof(VALUE)); + volatile VALUE t0 = ary_new(0, n); volatile VALUE t1 = tmpbuf(n, sizeof(int)); - VALUE *arrays = (VALUE*)RSTRING(t0)->ptr; /* The arrays we're computing the product of */ + VALUE *arrays = RARRAY(t0)->ptr; /* The arrays we're computing the product of */ int *counters = (int*)RSTRING(t1)->ptr; /* The current position in each one */ VALUE result; /* The array we'll be returning */ long i,j; -- cgit v1.2.3