Revision: 20520
Author:   [email protected]
Date:     Fri Apr  4 16:05:29 2014 UTC
Log:      Revert "Compare external pixel data length against Smi::kMaxValue"

This reverts r20519. Reason: wrong fix.

[email protected]

Review URL: https://codereview.chromium.org/226063003
http://code.google.com/p/v8/source/detail?r=20520

Modified:
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/api.cc  Fri Apr  4 15:25:37 2014 UTC
+++ /branches/bleeding_edge/src/api.cc  Fri Apr  4 16:05:29 2014 UTC
@@ -3741,7 +3741,8 @@
   ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return);
   ENTER_V8(isolate);
   i::HandleScope scope(isolate);
-  if (!Utils::ApiCheck(length >= 0 && length <= i::Smi::kMaxValue,
+  if (!Utils::ApiCheck(length >= 0 &&
+                       length <= i::ExternalUint8ClampedArray::kMaxLength,
                        "v8::Object::SetIndexedPropertiesToPixelData()",
                        "length exceeds max acceptable value")) {
     return;
@@ -3797,7 +3798,7 @@
ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return);
   ENTER_V8(isolate);
   i::HandleScope scope(isolate);
-  if (!Utils::ApiCheck(length >= 0 && length <= i::Smi::kMaxValue,
+ if (!Utils::ApiCheck(length >= 0 && length <= i::ExternalArray::kMaxLength,
                        "v8::Object::SetIndexedPropertiesToExternalArrayData()",
                        "length exceeds max acceptable value")) {
     return;
=======================================
--- /branches/bleeding_edge/src/objects.h       Fri Apr  4 15:25:37 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Fri Apr  4 16:05:29 2014 UTC
@@ -4700,6 +4700,9 @@
   // Casting.
   static inline ExternalArray* cast(Object* obj);

+  // Maximal acceptable length for an external array.
+  static const int kMaxLength = 0x3fffffff;
+
   // ExternalArray headers are not quadword aligned.
   static const int kExternalPointerOffset =
       POINTER_SIZE_ALIGN(FixedArrayBase::kLengthOffset + kPointerSize);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to