Re: BUG: segfault (with code)

From: nobu.nokada@...
Date: 2004-04-20 01:44:09 UTC
List: ruby-core #2795
Hi,

At Tue, 20 Apr 2004 10:25:02 +0900,
nobu.nokada@softhome.net wrote in [ruby-core:02794]:
> I guess aref_args should be a list node.

And CVS HEAD also seems wrong, shouldn't be like the latter?

  $ ruby -v -e 'def [](*args) p args; 0; end; def []=(*args) p args; end' -e 'self[*(0..1)]+=2'
  ruby 1.9.0 (2004-04-19) [i686-linux]
  [0]
  [0, 2]

  $ ./i686-linux/miniruby -v -e 'def [](*args) p args; 0; end; def []=(*args) p args; end' -e 'self[*(0..1)]+=2'
  ruby 1.8.1 (2004-04-19) [i686-linux]
  [[0, 1]]
  [[0, 1], 2]


Index: parse.y
===================================================================
RCS file: /cvs/ruby/src/ruby/parse.y,v
retrieving revision 1.319
diff -u -2 -p -r1.319 parse.y
--- parse.y	5 Apr 2004 13:16:40 -0000	1.319
+++ parse.y	20 Apr 2004 01:38:18 -0000
@@ -1236,5 +1236,5 @@ aref_args	: none
 		    {
 			value_expr($2);
-			$$ = newline_node(NEW_SPLAT($2));
+			$$ = NEW_LIST(NEW_SPLAT($2));
 		    }
 		;


-- 
Nobu Nakada

In This Thread