[0].product(0) dumps core

e$B1sF#$H?=$7$^$9!#e(B

1.9 e$B$Ge(B Array#product e$B$N0z?t$Ke(B Array
e$B0J30$rM?$($k$HMn$A$^$9!#e(B

$ ./ruby -e ‘[0].product(0)’
-e:1: – control frame ----------
c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :product
c:0003 p:0010 s:0005 b:0005 l:000004 d:000004 TOP -e:1
c:0002 p:---- s:0003 b:0003 l:000002 d:000002 FINISH :inherited
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

DBG> : “-e:1:in `’”
– backtrace of native function call (Use addr2line) –
0x80e6235
0x8103b13
0x8103bdb
0x80b8cc0
0xffffe420
0x80dcbee
0x80de916
0x80e1566
0x80e4b04
0x80e4e3b
0x8059ca9
0x805d5b0
0x80579b0
0xb7dd6ea8
0x80578d1

[BUG] Segmentation fault
ruby 1.9.0 (2007-11-06) [i686-linux]

e$B%"%!<%H$7$^$7$?e(B

e$B$3$s$J46$8$G$7$g$&$+!#e(B

Index: array.c

— array.c (revision 13827)
+++ array.c (working copy)
@@ -3169,7 +3169,7 @@

 /* initialize the arrays of arrays */
 arrays[0] = ary;
  • for (i = 1; i < n; i++) arrays[i] = argv[i-1];
  • for (i = 1; i < n; i++) arrays[i] = to_ary(argv[i-1]);

    /* initialize the counters for the arrays */
    for (i = 0; i < n; i++) counters[i] = 0;