summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-06 00:05:07 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-06 00:05:07 +0000
commitac6eedd93287969bfc215ae0645b76d75c0ade45 (patch)
tree35efb135e548c50be7d8632fa1199e41d1ce99a0 /parse.y
parent7e575886770ff014948176608d3507634a68ffb6 (diff)
merge revision(s) 18318:
* 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_7@21351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 3 insertions, 1 deletions
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') {