From 05c96af27b1eedf575cb4925faf4618de57a2479 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 2 Aug 2008 06:51:53 +0000 Subject: [PATCH] * parse.y (yylex): 8 and 9 in octal integer should cause compile error. [ruby-dev:35729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ parse.y | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a09b5d735b..b475138d74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Aug 2 15:51:50 2008 Nobuyoshi Nakada + + * parse.y (yylex): 8 and 9 in octal integer should cause compile + error. [ruby-dev:35729] + Sat Aug 2 11:51:42 2008 Nobuyoshi Nakada * rubysig.h (CHECK_INTS): gives the chance to perform to deferred diff --git a/parse.y b/parse.y index 08c0323724..452d209a8b 100644 --- a/parse.y +++ b/parse.y @@ -3969,7 +3969,8 @@ yylex() 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 @@ yylex() } } if (c > '7' && c <= '9') { + invalid_octal: yyerror("Illegal octal digit"); } else if (c == '.' || c == 'e' || c == 'E') {