- a/Source/JavaScriptCore/ChangeLog +24 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2016-02-18  Chris Dumez  <cdumez@apple.com>
2
3
        Crash on SES selftest page when loading the page while WebInspector is open
4
        https://bugs.webkit.org/show_bug.cgi?id=154378
5
        <rdar://problem/24713422>
6
7
        Reviewed by NOBODY (OOPS!).
8
9
        Do a partial revert of r196676 so that JSObject::getOwnPropertyDescriptor()
10
        returns early again if it detects that getOwnPropertySlot() returns a
11
        non-own property. This check was removed in r196676 because we assumed that
12
        only JSDOMWindow::getOwnPropertySlot() could return non-own properties.
13
        However, as it turns out, DebuggerScope::getOwnPropertySlot() does so as
14
        well.
15
16
        Not having the check would lead to crashes when using the debugger because
17
        we would get a slot with the CustomAccessor attribute but getDirect() would
18
        then fail to return the property (because it is not an own property). We
19
        would then cast the value returned by getDirect() to a CustomGetterSetter*
20
        and dereference it.
21
22
        * runtime/JSObject.cpp:
23
        (JSC::JSObject::getOwnPropertyDescriptor):
24
1
2016-02-17  Benjamin Poulain  <bpoulain@apple.com>
25
2016-02-17  Benjamin Poulain  <bpoulain@apple.com>
2
26
3
        [JSC] ARM64: Support the immediate format used for bit operations in Air
27
        [JSC] ARM64: Support the immediate format used for bit operations in Air
- a/Source/JavaScriptCore/runtime/JSObject.cpp +9 lines
Lines 2556-2561 bool JSObject::getOwnPropertyDescriptor(ExecState* exec, PropertyName propertyNa a/Source/JavaScriptCore/runtime/JSObject.cpp_sec1
2556
    if (!methodTable(exec->vm())->getOwnPropertySlot(this, exec, propertyName, slot))
2556
    if (!methodTable(exec->vm())->getOwnPropertySlot(this, exec, propertyName, slot))
2557
        return false;
2557
        return false;
2558
2558
2559
    // DebuggerScope::getOwnPropertySlot() (and possibly others) may return attributes from the prototype chain
2560
    // but getOwnPropertyDescriptor() should only work for 'own' properties so we exit early if we detect that
2561
    // the property is not an own property.
2562
    if (slot.slotBase() != this && slot.slotBase()) {
2563
        auto* proxy = jsDynamicCast<JSProxy*>(this);
2564
        if (!proxy || proxy->target() != slot.slotBase())
2565
            return false;
2566
    }
2567
2559
    if (slot.isAccessor())
2568
    if (slot.isAccessor())
2560
        descriptor.setAccessorDescriptor(slot.getterSetter(), slot.attributes());
2569
        descriptor.setAccessorDescriptor(slot.getterSetter(), slot.attributes());
2561
    else if (slot.attributes() & CustomAccessor) {
2570
    else if (slot.attributes() & CustomAccessor) {

Return to Bug 154378