$00..0 dumps core


#1

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

1.8.6 e$B!"e(B1.9 e$B6&$K0J2<$N$h$&$K$9$k$HMn$A$^$9!#e(B

$ ./ruby -e ‘$00…0’
-e:1: identifier $00 is not valid
-e:1: [BUG] Segmentation fault
ruby 1.8.6 (2007-06-30) [i686-linux]

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

e$B$^$?!"e(B0…$00=1 e$B$G$bMn$A$^$9!#e(B

e$B$3$Ne(B 2 e$B$D$@$1$K4X$7$F$OKvHx$N%Q%C%A$GMn$A$J$/$J$j$^$7$?$,!“e(B
gettable e$B$de(B assignable
e$B$r;HMQ$7$F$$$k2U=j$OB>$K$b7k9=$”$k$N$Ge(B
e$B$^$@2?$+$7$J$$$H$$$1$J$$$+$b$7$l$^$;$s!#e(B
e$BNc$($P!"e(B1.9 e$B$Ge(B $00+=1
e$B$r<B9T$9$k$H2x$7$$$3$H$r8@$o$l$^$9!#e(B
(e$B$A$c$s$HDI$C$F$J$$$N$GJL$NLdBj$+$b$7$l$^$;$s$,e(B)

$ ./ruby -e ‘$00+=1’
identifier $00 is not valid
identifier (null) is not valid

Index: parse.y

— parse.y (revision 12674)
+++ parse.y (working copy)
@@ -841,7 +841,7 @@

lhs : variable
{

  •  $$ = assignable($1, 0);
    
  •  if(!($$ = assignable($1, 0))) $$ = NEW_NIL();
       }
    
    | primary_value ‘[’ aref_args ‘]’
    {
    @@ -2200,7 +2200,7 @@

var_ref : variable
{

  •  $$ = gettable($1);
    
  •  if(!($$ = gettable($1))) $$ = NEW_NIL();
       }
    
    ;