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

Changeset 211065 in webkit


Ignore:
Timestamp:
Jan 23, 2017, 3:13:41 PM (10 years ago)
Author:
fpizlo@apple.com
Message:

SharedArrayBuffer plus WebGL should not equal CRASH
https://bugs.webkit.org/show_bug.cgi?id=167329

Reviewed by Saam Barati.

Source/JavaScriptCore:

DOM unwrapping methods should return null rather than crashing. The code expects an
unshared buffer, so we should return null when it's shared. The caller can then decide
if they like null or not.

  • runtime/JSArrayBufferViewInlines.h:

(JSC::JSArrayBufferView::toWrapped):

LayoutTests:

This test used to crash and now it doesn't. It throws some exception.

  • js/shared-array-buffer-webgl-expected.txt: Added.
  • js/shared-array-buffer-webgl.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211060 r211065  
     12017-01-23  Filip Pizlo  <fpizlo@apple.com>
     2
     3        SharedArrayBuffer plus WebGL should not equal CRASH
     4        https://bugs.webkit.org/show_bug.cgi?id=167329
     5
     6        Reviewed by Saam Barati.
     7       
     8        This test used to crash and now it doesn't. It throws some exception.
     9
     10        * js/shared-array-buffer-webgl-expected.txt: Added.
     11        * js/shared-array-buffer-webgl.html: Added.
     12
    1132017-01-23  Myles C. Maxfield  <mmaxfield@apple.com>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r211063 r211065  
     12017-01-23  Filip Pizlo  <fpizlo@apple.com>
     2
     3        SharedArrayBuffer plus WebGL should not equal CRASH
     4        https://bugs.webkit.org/show_bug.cgi?id=167329
     5
     6        Reviewed by Saam Barati.
     7       
     8        DOM unwrapping methods should return null rather than crashing. The code expects an
     9        unshared buffer, so we should return null when it's shared. The caller can then decide
     10        if they like null or not.
     11
     12        * runtime/JSArrayBufferViewInlines.h:
     13        (JSC::JSArrayBufferView::toWrapped):
     14
    1152017-01-23  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferViewInlines.h

    r208209 r211065  
    9292inline RefPtr<ArrayBufferView> JSArrayBufferView::toWrapped(JSValue value)
    9393{
    94     if (JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(value))
    95         return view->unsharedImpl();
     94    if (JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(value)) {
     95        if (!view->isShared())
     96            return view->unsharedImpl();
     97    }
    9698    return nullptr;
    9799}
Note: See TracChangeset for help on using the changeset viewer.