V0,(*,v1,) = 0 dumps core


#1

e$B0J2<$N$h$&$K$9$k$He(B SEGV e$B$7$^$9!#e(B

% ./ruby -e ‘v0,(*,v1,) = 0’
– control frame ----------
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

– backtrace of native function call (Use addr2line) –
0x80f03b4
0x8109bfe
0x80bec89
0xb7f6d420
0x811d928
0x81224a3
0x811d2bd
0x811d38e
0x811d372
0x81224a3
0x811ad21
0x80e20bd
0x80e2109
0x80e204c
0x80f05e3
0x80f064a
0x8059c6c
0x8059ca9
0x8059ce4
0x8056e72
0xb7dd6ea8
0x8056da1


#2

e$B$J$+$@$G$9!#e(B

At Mon, 2 Jul 2007 02:25:14 +0900,
Tanaka A. wrote in [ruby-dev:31104]:

e$B0J2<$N$h$&$K$9$k$He(B SEGV e$B$7$^$9!#e(B

% ./ruby -e ‘v0,(*,v1,) = 0’

POSTARGe$B$NA0$NL5L>$Ne(Bsplate$B$,L$BP1~e(B?

Index: compile.c

— compile.c (revision 12677)
+++ compile.c (working copy)
@@ -2040,6 +2040,6 @@ compile_massign(rb_iseq_t *iseq, LINK_AN
if (lhs_splat) {
if (nd_type(splatn) == NODE_POSTARG) {

  • int num = splatn->nd_2nd->nd_alen;
    NODE *n = splatn->nd_2nd;
  • int num = n->nd_alen;

    ADD_INSN (ret, nd_line(n), dup);
    @@ -2055,5 +2055,11 @@ compile_massign(rb_iseq_t *iseq, LINK_AN
    }

  • make_masgn_lhs(iseq, ret, splatn->nd_1st);
  • lhsn = splatn->nd_1st;
  • if (lhsn == (NODE *)-1) {
  •    ADD_INSN(ret, nd_line(splatn), pop);
    
  • }
  • else {
  •    make_masgn_lhs(iseq, ret, lhsn);
    
  • }
    }
    else {