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

Unified Diff: src/v8natives.js

Issue 7206019: Fix "illegal access" when calling parseInt with a radix that is not a smi. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 9 years, 6 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-1246.js » ('j') | test/mjsunit/regress/regress-1246.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 6ad4a0c75bdb1648492c56ced8170c61faa7749c..da12ccd907ce88c6556874681d27ee8cd4f8724f 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -106,7 +106,7 @@ function GlobalParseInt(string, radix) {
// Truncate number.
return string | 0;
}
- if (IS_UNDEFINED(radix)) radix = 0;
+ radix = radix || 0;
Lasse Reichstein 2011/06/28 08:32:21 This seems silly to begin with. Just set radix =
Steven 2011/06/28 10:10:35 It seems so but it's not: 'radix = 0' will trigger
Lasse Reichstein 2011/06/28 10:28:17 Ack, my bad. In that case, use radix = TO_INT32(r
Lasse Reichstein 2011/06/28 10:31:48 and because radix = radix || 0 would not convert
} else {
radix = TO_INT32(radix);
if (!(radix == 0 || (2 <= radix && radix <= 36)))
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1246.js » ('j') | test/mjsunit/regress/regress-1246.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698