summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--array.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f4d6f4937f..8d4eff5848 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri May 28 17:34:48 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * array.c (rb_ary_product): Ensure arrays to be marked by GC.
+
Fri May 28 10:40:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (checking_for): ignore toplevel.
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;