diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 3a64f084ae23..358bf18c269e 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -634,15 +634,16 @@ inline void JSObject::copyDenseArrayElements(uintN dstStart, const js::Value *src, uintN count) { JS_ASSERT(dstStart + count <= getDenseArrayCapacity()); - prepareElementRangeForOverwrite(dstStart, dstStart + count); - memcpy(elements + dstStart, src, count * sizeof(js::Value)); + for (unsigned i = 0; i < count; ++i) + elements[dstStart + i] = src[i]; } inline void JSObject::initDenseArrayElements(uintN dstStart, const js::Value *src, uintN count) { JS_ASSERT(dstStart + count <= getDenseArrayCapacity()); - memcpy(elements + dstStart, src, count * sizeof(js::Value)); + for (unsigned i = 0; i < count; ++i) + elements[dstStart + i].init(src[i]); } inline void