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

Unified Diff: src/typedarray.js

Issue 80653002: Merged r17800, r17801 into 3.21 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.21
Patch Set: Created 7 years, 1 month 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 | « src/runtime.cc ('k') | src/version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typedarray.js
diff --git a/src/typedarray.js b/src/typedarray.js
index 7bd16f670b4425b88319676a52374c480b5b2477..e12230dd7186e6ab49a5a4a72b4bae2c46fed1fe 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -77,6 +77,9 @@ function CreateTypedArrayConstructor(name, elementSize, arrayId, constructor) {
function ConstructByArrayLike(obj, arrayLike) {
var length = arrayLike.length;
var l = ToPositiveInteger(length, "invalid_typed_array_length");
+ if (l > %MaxSmi()) {
+ throw MakeRangeError("invalid_typed_array_length");
+ }
if(!%TypedArrayInitializeFromArrayLike(obj, arrayId, arrayLike, l)) {
for (var i = 0; i < l; i++) {
obj[i] = arrayLike[i];
« no previous file with comments | « src/runtime.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698