Ignore:
Timestamp:
Sep 27, 2017, 9:19:13 PM (8 years ago)
Author:
[email protected]
Message:

JSArray::canFastCopy() should fail if the source and destination arrays are the same.
https://bugs.webkit.org/show_bug.cgi?id=177584
<rdar://problem/34463903>

Reviewed by Saam Barati.

JSTests:

  • stress/regress-177584.js: Added.

(assertEqual):
(Array.prototype.Symbol.species):

Source/JavaScriptCore:

If the source and destination arrays are the same, we may be copying overlapping
regions. Hence, we need to take the slow path.

  • runtime/JSArrayInlines.h:

(JSC::JSArray::canFastCopy):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSArrayInlines.h

    r222565 r222598  
    5959inline bool JSArray::canFastCopy(VM& vm, JSArray* otherArray)
    6060{
     61    if (otherArray == this)
     62        return false;
    6163    if (hasAnyArrayStorage(indexingType()) || hasAnyArrayStorage(otherArray->indexingType()))
    6264        return false;
Note: See TracChangeset for help on using the changeset viewer.