Changeset 209025 in webkit


Ignore:
Timestamp:
Nov 28, 2016 2:56:08 PM (7 years ago)
Author:
mark.lam@apple.com
Message:

Fix exception scope verification failures in more miscellaneous files.
https://bugs.webkit.org/show_bug.cgi?id=165102

Reviewed by Saam Barati.

Source/JavaScriptCore:

  • wasm/js/WebAssemblyInstanceConstructor.cpp:

(JSC::constructJSWebAssemblyInstance):

Source/WebCore:

No new tests because these are fixes to failures detected by existing tests when
exception check verification is enabled.

  • bindings/js/IDBBindingUtilities.cpp:

(WebCore::toJS):

  • bindings/js/JSCommandLineAPIHostCustom.cpp:

(WebCore::getJSListenerFunctions):

  • bindings/js/JSCryptoKeySerializationJWK.cpp:

(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):

  • bindings/js/JSDOMBinding.h:

(WebCore::toJS):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::put):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209023 r209025  
     12016-11-28  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix exception scope verification failures in more miscellaneous files.
     4        https://bugs.webkit.org/show_bug.cgi?id=165102
     5
     6        Reviewed by Saam Barati.
     7
     8        * wasm/js/WebAssemblyInstanceConstructor.cpp:
     9        (JSC::constructJSWebAssemblyInstance):
     10
    1112016-11-28  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp

    r208401 r209025  
    8181    VariableEnvironment lexicalVariables;
    8282    auto* moduleRecord = JSModuleRecord::create(state, vm, globalObject->moduleRecordStructure(), moduleKey, sourceCode, declaredVariables, lexicalVariables);
     83    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    8384    auto* moduleNamespaceObject = JSModuleNamespaceObject::create(state, globalObject, globalObject->moduleNamespaceObjectStructure(), moduleRecord, instanceExports);
     85    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    8486
    8587    auto* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), globalObject->WebAssemblyInstanceStructure());
  • trunk/Source/WebCore/ChangeLog

    r209021 r209025  
     12016-11-28  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix exception scope verification failures in more miscellaneous files.
     4        https://bugs.webkit.org/show_bug.cgi?id=165102
     5
     6        Reviewed by Saam Barati.
     7
     8        No new tests because these are fixes to failures detected by existing tests when
     9        exception check verification is enabled.
     10
     11        * bindings/js/IDBBindingUtilities.cpp:
     12        (WebCore::toJS):
     13        * bindings/js/JSCommandLineAPIHostCustom.cpp:
     14        (WebCore::getJSListenerFunctions):
     15        * bindings/js/JSCryptoKeySerializationJWK.cpp:
     16        (WebCore::buildJSONForRSAComponents):
     17        (WebCore::addUsagesToJSON):
     18        * bindings/js/JSDOMBinding.h:
     19        (WebCore::toJS):
     20        * bridge/runtime_array.cpp:
     21        (JSC::RuntimeArray::put):
     22
    1232016-11-28  Dave Hyatt  <hyatt@apple.com>
    224
  • trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp

    r208985 r209025  
    102102        auto outArray = constructEmptyArray(&state, 0, &globalObject, size);
    103103        RETURN_IF_EXCEPTION(scope, JSValue());
    104         for (size_t i = 0; i < size; ++i)
     104        for (size_t i = 0; i < size; ++i) {
    105105            outArray->putDirectIndex(&state, i, toJS(state, globalObject, inArray.at(i).get()));
     106            RETURN_IF_EXCEPTION(scope, JSValue());
     107        }
    106108        return outArray;
    107109    }
  • trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp

    r206386 r209025  
    9292        listenerEntry->putDirect(vm, Identifier::fromString(&state, "useCapture"), jsBoolean(listenerInfo.eventListenerVector[i]->useCapture()));
    9393        result->putDirectIndex(&state, outputIndex++, JSValue(listenerEntry));
     94        RETURN_IF_EXCEPTION(scope, nullptr);
    9495    }
    9596    return result;
  • trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp

    r208985 r209025  
    572572        addToJSON(exec, jsPrimeInfo, "t", base64URLEncode(data.otherPrimeInfos()[i].factorCRTCoefficient));
    573573        oth->putDirectIndex(exec, i, jsPrimeInfo);
     574        RETURN_IF_EXCEPTION(scope, void());
    574575    }
    575576    result->putDirect(vm, Identifier::fromString(exec, "oth"), oth);
     
    695696
    696697    unsigned index = 0;
    697     if (usages & CryptoKeyUsageSign)
     698    if (usages & CryptoKeyUsageSign) {
    698699        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("sign")));
    699     if (usages & CryptoKeyUsageVerify)
     700        RETURN_IF_EXCEPTION(scope, void());
     701    }
     702    if (usages & CryptoKeyUsageVerify) {
    700703        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("verify")));
    701     if (usages & CryptoKeyUsageEncrypt)
     704        RETURN_IF_EXCEPTION(scope, void());
     705    }
     706    if (usages & CryptoKeyUsageEncrypt) {
    702707        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("encrypt")));
    703     if (usages & CryptoKeyUsageDecrypt)
     708        RETURN_IF_EXCEPTION(scope, void());
     709    }
     710    if (usages & CryptoKeyUsageDecrypt) {
    704711        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("decrypt")));
    705     if (usages & CryptoKeyUsageWrapKey)
     712        RETURN_IF_EXCEPTION(scope, void());
     713    }
     714    if (usages & CryptoKeyUsageWrapKey) {
    706715        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("wrapKey")));
    707     if (usages & CryptoKeyUsageUnwrapKey)
     716        RETURN_IF_EXCEPTION(scope, void());
     717    }
     718    if (usages & CryptoKeyUsageUnwrapKey) {
    708719        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("unwrapKey")));
    709     if (usages & CryptoKeyUsageDeriveKey)
     720        RETURN_IF_EXCEPTION(scope, void());
     721    }
     722    if (usages & CryptoKeyUsageDeriveKey) {
    710723        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("deriveKey")));
    711     if (usages & CryptoKeyUsageDeriveBits)
     724        RETURN_IF_EXCEPTION(scope, void());
     725    }
     726    if (usages & CryptoKeyUsageDeriveBits) {
    712727        keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("deriveBits")));
     728        RETURN_IF_EXCEPTION(scope, void());
     729    }
    713730
    714731    json->putDirect(vm, Identifier::fromString(exec, "key_ops"), keyOps);
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r208893 r209025  
    11/*
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2013 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2003-2006, 2008-2009, 2013, 2016 Apple Inc. All rights reserved.
    44 *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
    55 *  Copyright (C) 2009 Google, Inc. All rights reserved.
     
    659659    JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
    660660    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
    661     for (size_t i = 0; i < vector.size(); ++i)
     661    for (size_t i = 0; i < vector.size(); ++i) {
    662662        array->putDirectIndex(exec, i, toJS(exec, globalObject, vector[i]));
     663        RETURN_IF_EXCEPTION(scope, JSC::JSValue());
     664    }
    663665    return array;
    664666}
     
    671673    JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
    672674    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
    673     for (size_t i = 0; i < vector.size(); ++i)
     675    for (size_t i = 0; i < vector.size(); ++i) {
    674676        array->putDirectIndex(exec, i, toJS(exec, globalObject, vector[i].get()));
     677        RETURN_IF_EXCEPTION(scope, JSC::JSValue());
     678    }
    675679    return array;
    676680}
  • trunk/Source/WebCore/bridge/runtime_array.cpp

    r208985 r209025  
    128128    if (std::optional<uint32_t> index = parseIndex(propertyName))
    129129        return thisObject->getConcreteArray()->setValueAt(exec, index.value(), value);
    130    
     130
     131    scope.release();
    131132    return JSObject::put(thisObject, exec, propertyName, value, slot);
    132133}
Note: See TracChangeset for help on using the changeset viewer.