Revert "Compare external pixel data length against Smi::kMaxValue"

This reverts r20519. Reason: wrong fix.

TBR=rossberg@chromium.org

Review URL: https://codereview.chromium.org/226063003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cd810657
......@@ -3741,7 +3741,8 @@ void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
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 @@ void v8::Object::SetIndexedPropertiesToExternalArrayData(
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;
......
......@@ -4700,6 +4700,9 @@ class ExternalArray: public FixedArrayBase {
// 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment