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

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: Rewrote tests and addressed comments. 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') | no next file with comments »
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..4710dc799b095c206dbcae4a11145af3494c86c3 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -106,11 +106,12 @@ function GlobalParseInt(string, radix) {
// Truncate number.
return string | 0;
}
- if (IS_UNDEFINED(radix)) radix = 0;
+ radix = radix || 0;
} else {
radix = TO_INT32(radix);
- if (!(radix == 0 || (2 <= radix && radix <= 36)))
+ if (!(radix == 0 || (2 <= radix && radix <= 36))) {
return $NaN;
+ }
}
string = TO_STRING_INLINE(string);
if (%_HasCachedArrayIndex(string) &&
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1246.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698