ts <decoux / moulon.inra.fr> wrote:
> >>>>> "B" == Brian F Feldman <green / FreeBSD.org> writes:
> 
> B> Of course, this used to work and it seems it just crashes Ruby now....
> 
>  Can you try this patch
> 
> pigeon% diff -u parse.y~ parse.y
> --- parse.y~    Mon Sep  3 07:29:18 2001
> +++ parse.y     Wed Sep 26 16:50:42 2001
> @@ -690,10 +690,10 @@
>                     }
>                 | primary '[' aref_args ']' tOP_ASGN arg
>                     {
> -                       NODE *args = NEW_LIST($6);
> +                       NODE *tmp, *args = NEW_LIST($6);
>  
> -                       list_append($3, NEW_NIL());
> -                       list_concat(args, $3);
> +                       tmp = list_append($3, NEW_NIL());
> +                       list_concat(args, tmp);
>                         if ($5 == tOROP) {
>                             $5 = 0;
>                         }
> pigeon% 

That's not quite enough.  However, if you also change eval.c:

@@ -2723,7 +2726,7 @@
            recv = rb_eval(self, node->nd_recv);
            rval = node->nd_args->nd_head;
            SETUP_ARGS(node->nd_args->nd_next);
-           val = rb_funcall2(recv, aref, argc-1, argv);
+           val = rb_funcall2(recv, aref, argc ? argc - 1 : 0, argv);
            switch (node->nd_mid) {
            case 0: /* OR */
                if (RTEST(val)) RETURN(val);
@@ -2736,8 +2739,13 @@
            default:
                val = rb_funcall(val, node->nd_mid, 1, rb_eval(self, rval));
            }
-           argv[argc-1] = val;
-           val = rb_funcall2(recv, aset, argc, argv);
+           if (argc) {
+               argv[argc-1] = val;
+               val = rb_funcall2(recv, aset, argc, argv);
+           } else {
+               argv = &val;
+               val = rb_funcall2(recv, aset, 1, argv);
+           }
            result = val;
        }
        break;

Things will work.  I'm not convinced this is correct, but it tests out okay.

-- 
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green / FreeBSD.org                    `------------------------------'