Bug 637643 - A subarray of a typed array subarray not at offset zero doesn't contain the right data. r=jwalden

--HG--
extra : rebase_source : f6fe88592e66101dc065bd82f35e4d2f3fd1cb1a
This commit is contained in:
async.processingjs@yahoo.com 2011-03-14 10:17:36 -07:00
parent 0dc25a462f
commit c5822baf18

View File

@ -1105,7 +1105,8 @@ class TypedArrayTemplate
uint32 length = end - begin;
JS_ASSERT(begin < UINT32_MAX / sizeof(NativeType));
uint32 byteOffset = begin * sizeof(NativeType);
JS_ASSERT(UINT32_MAX - begin * sizeof(NativeType) >= tarray->byteOffset);
uint32 byteOffset = tarray->byteOffset + begin * sizeof(NativeType);
return createTypedArray(cx, bufobj, byteOffset, length);
}