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

Unified Diff: src/conversions.cc

Issue 6903171: Don't allow whitespace after sign characters in parseInt. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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-955.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
diff --git a/src/conversions.cc b/src/conversions.cc
index 14585845de2f55c47d2052402cef3bcc1531650e..5cf5efd2789d55b18a3d216e830c8ccf17761ce3 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -254,12 +254,12 @@ static double InternalStringToInt(UnicodeCache* unicode_cache,
if (*current == '+') {
// Ignore leading sign; skip following spaces.
++current;
- if (!AdvanceToNonspace(unicode_cache, &current, end)) {
+ if (current == end) {
return JUNK_STRING_VALUE;
}
} else if (*current == '-') {
++current;
- if (!AdvanceToNonspace(unicode_cache, &current, end)) {
+ if (current == end) {
return JUNK_STRING_VALUE;
}
negative = true;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-955.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698