ruby-1.8.7-p78
ChangeLog
Tue Jan 6 09:03:35 2009 Nobuyoshi Nakada <nobu@...> * parse.y (yylex): 8 and 9 in octal integer should cause compile error. [ruby-dev:35729]
ソースコードの修正内容
Index: parse.y =================================================================== --- parse.y (.../v1_8_7_77) (revision 22266) +++ parse.y (.../v1_8_7_78) (revision 22266) @@ -3969,7 +3969,8 @@ nondigit = c; continue; } - if (c < '0' || c > '7') break; + if (c < '0' || c > '9') break; + if (c > '7') goto invalid_octal; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); @@ -3986,6 +3987,7 @@ } } if (c > '7' && c <= '9') { + invalid_octal: yyerror("Illegal octal digit"); } else if (c == '.' || c == 'e' || c == 'E') {
不具合の内容や影響範囲
008 のように 3 桁以上の 8 以上の数字を含む 8 進数のリテラルを解析した際、整数として不正であるというシンタックスエラー(syntax error, unexpected tINTEGER, expecting $end) が発生する。
全てのプラットフォームが対象。