summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-11 04:21:18 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-11 04:21:18 +0000
commit27a0ad31c490fee6f69107a6d6c83cf19a0436d0 (patch)
treef686428df6edf3cddb7c059718bba2a82e749b50 /array.c
parent24d86dc09d4cef6de3e5667506b583d376cc8c6e (diff)
merges r28187 and r28189 from trunk into ruby_1_9_2.
-- * array.c (rb_ary_product): clear uninitialized elements in temporary array. -- * test/ruby/test_array.rb (test_product): test for r28187. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/array.c b/array.c
index 35335f5437..04c244a385 100644
--- a/array.c
+++ b/array.c
@@ -4308,6 +4308,7 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
/* initialize the arrays of arrays */
ARY_SET_LEN(t0, n);
arrays[0] = ary;
+ for (i = 1; i < n; i++) arrays[i] = Qnil;
for (i = 1; i < n; i++) arrays[i] = to_ary(argv[i-1]);
/* initialize the counters for the arrays */