Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: src/json-parser.h

Issue 11198068: Fixed error introduced in r12761. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2373.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index 3161a01a79cd86ae62a88051090dce6556c15fab..9ccc8ed1fb320c087b0fbaddf01d2b9bc9fddb2b 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -400,12 +400,14 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonNumber() {
if ('0' <= c0_ && c0_ <= '9') return ReportUnexpectedCharacter();
} else {
int i = 0;
+ int digits = 0;
if (c0_ < '1' || c0_ > '9') return ReportUnexpectedCharacter();
do {
i = i * 10 + c0_ - '0';
+ digits++;
Advance();
- } while (c0_ >= '0' && c0_ <= '9' && i <= (kMaxInt - 9) / 10);
- if (c0_ != '.' && c0_ != 'e' && c0_ != 'E') {
+ } while (c0_ >= '0' && c0_ <= '9');
+ if (c0_ != '.' && c0_ != 'e' && c0_ != 'E' && digits < 10) {
SkipWhitespace();
return Handle<Smi>(Smi::FromInt((negative ? -i : i)), isolate());
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2373.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698