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

Changeset 235558 in webkit


Ignore:
Timestamp:
Aug 31, 2018, 10:12:32 AM (8 years ago)
Author:
mark.lam@apple.com
Message:

Fix exception check accounting in constructJSWebAssemblyCompileError().
https://bugs.webkit.org/show_bug.cgi?id=189185
<rdar://problem/39786007>

Reviewed by Michael Saboff.

JSTests:

  • stress/regress-189185.js: Added.

(new.WebAssembly.CompileError.valueOf):

Source/JavaScriptCore:

Also add an exception check in JSWebAssemblyModule::createStub() so that we don't
inadvertently overwrite a pre-existing exception (if present).

  • wasm/js/JSWebAssemblyModule.cpp:

(JSC::JSWebAssemblyModule::createStub):

  • wasm/js/WebAssemblyCompileErrorConstructor.cpp:

(JSC::constructJSWebAssemblyCompileError):

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r235554 r235558  
     12018-08-31  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix exception check accounting in constructJSWebAssemblyCompileError().
     4        https://bugs.webkit.org/show_bug.cgi?id=189185
     5        <rdar://problem/39786007>
     6
     7        Reviewed by Michael Saboff.
     8
     9        * stress/regress-189185.js: Added.
     10        (new.WebAssembly.CompileError.valueOf):
     11
    1122018-08-31  Mark Lam  <mark.lam@apple.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r235557 r235558  
     12018-08-31  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix exception check accounting in constructJSWebAssemblyCompileError().
     4        https://bugs.webkit.org/show_bug.cgi?id=189185
     5        <rdar://problem/39786007>
     6
     7        Reviewed by Michael Saboff.
     8
     9        Also add an exception check in JSWebAssemblyModule::createStub() so that we don't
     10        inadvertently overwrite a pre-existing exception (if present).
     11
     12        * wasm/js/JSWebAssemblyModule.cpp:
     13        (JSC::JSWebAssemblyModule::createStub):
     14        * wasm/js/WebAssemblyCompileErrorConstructor.cpp:
     15        (JSC::constructJSWebAssemblyCompileError):
     16
    1172018-08-31  Mark Lam  <mark.lam@apple.com>
    218
  • trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp

    r235420 r235558  
    4949    auto scope = DECLARE_THROW_SCOPE(vm);
    5050    if (!result.has_value()) {
    51         throwException(exec, scope, JSWebAssemblyCompileError::create(exec, vm, structure->globalObject()->WebAssemblyCompileErrorStructure(), result.error()));
     51        auto* error = JSWebAssemblyCompileError::create(exec, vm, structure->globalObject()->WebAssemblyCompileErrorStructure(), result.error());
     52        RETURN_IF_EXCEPTION(scope, nullptr);
     53        throwException(exec, scope, error);
    5254        return nullptr;
    5355    }
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp

    r233122 r235558  
    5252    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject(vm)->WebAssemblyCompileErrorStructure());
    5353    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     54    scope.release();
    5455    return JSValue::encode(JSWebAssemblyCompileError::create(exec, vm, structure, message));
    5556}
Note: See TracChangeset for help on using the changeset viewer.