⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 194399 in webkit


Ignore:
Timestamp:
Dec 23, 2015, 3:31:44 PM (11 years ago)
Author:
Brent Fulgham
Message:

Source/WebCore:
Avoids stack recursion when indexed propertyNames defined using Object.defineProperty are deleted.
https://bugs.webkit.org/show_bug.cgi?id=149179
<rdar://problem/22708019>.

Patch by Pranjal Jumde <pjumde@apple.com> on 2015-12-23
Reviewed by Filip Pizlo.

  • runtime/JSObject.cpp:

(JSStorage::deletePropertyByIndex was invoking Base::deleteProperty for indexed propertyNames instead of Base::deletePropertyByIndex leading to a stack recursion)

LayoutTests:
Test to check for stack recursion when indexed propertyNames defined using Object.defineProperty are deleted.
https://bugs.webkit.org/show_bug.cgi?id=149179
<rdar://problem/22708019>.

Patch by Pranjal Jumde <pjumde@apple.com> on 2015-12-23
Reviewed by Filip Pizlo.

  • storage/domstorage/localstorage/delete-defineproperty-removal-expected.txt: Added.
  • storage/domstorage/localstorage/delete-defineproperty-removal.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194397 r194399  
     12015-12-23  Pranjal Jumde  <pjumde@apple.com>
     2
     3        Test to check for stack recursion when indexed propertyNames defined using Object.defineProperty are deleted.
     4        https://bugs.webkit.org/show_bug.cgi?id=149179
     5        <rdar://problem/22708019>.
     6
     7        Reviewed by Filip Pizlo.
     8
     9        * storage/domstorage/localstorage/delete-defineproperty-removal-expected.txt: Added.
     10        * storage/domstorage/localstorage/delete-defineproperty-removal.html: Added.
     11
    1122015-12-23  Eric Carlson  <eric.carlson@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r194397 r194399  
     12015-12-23  Pranjal Jumde  <pjumde@apple.com>
     2
     3        Avoids stack recursion when indexed propertyNames defined using Object.defineProperty are deleted.
     4        https://bugs.webkit.org/show_bug.cgi?id=149179
     5        <rdar://problem/22708019>.
     6
     7        Reviewed by Filip Pizlo.
     8
     9        * runtime/JSObject.cpp:
     10        (JSStorage::deletePropertyByIndex was invoking Base::deleteProperty for indexed propertyNames instead of Base::deletePropertyByIndex leading to a stack recursion)
     11
    1122015-12-23  Eric Carlson  <eric.carlson@apple.com>
    213
  • trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp

    r191887 r194399  
    5959    // the native property slots manually.
    6060    PropertySlot slot(thisObject);
    61     if (getStaticValueSlot<JSStorage, Base>(exec, *s_info.staticPropHashTable, thisObject, propertyName, slot))
     61    if (getStaticValueSlot<JSStorage, Base>(exec, *s_info.staticPropHashTable, thisObject, propertyName, slot)) {
     62        if (Optional<uint32_t> index = parseIndex(propertyName))
     63            return Base::deletePropertyByIndex(thisObject, exec, index.value());
    6264        return Base::deleteProperty(thisObject, exec, propertyName);
    63 
     65    }
    6466    JSValue prototype = thisObject->prototype();
    6567    if (prototype.isObject() && asObject(prototype)->getPropertySlot(exec, propertyName, slot))
     
    7779bool JSStorage::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
    7880{
     81    JSStorage* thisObject = jsCast<JSStorage*>(cell);
     82    PropertySlot slot(thisObject);
     83    if (getStaticValueSlot<JSStorage, Base>(exec, *s_info.staticPropHashTable, thisObject, Identifier::from(exec, propertyName), slot))
     84        return Base::deletePropertyByIndex(thisObject, exec, propertyName);
    7985    return deleteProperty(cell, exec, Identifier::from(exec, propertyName));
    8086}
Note: See TracChangeset for help on using the changeset viewer.