Title: [209025] trunk/Source
Revision
209025
Author
mark....@apple.com
Date
2016-11-28 14:56:08 -0800 (Mon, 28 Nov 2016)

Log Message

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

Reviewed by Saam Barati.

Source/_javascript_Core:

* 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (209024 => 209025)


--- trunk/Source/_javascript_Core/ChangeLog	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-11-28 22:56:08 UTC (rev 209025)
@@ -1,5 +1,15 @@
 2016-11-28  Mark Lam  <mark....@apple.com>
 
+        Fix exception scope verification failures in more miscellaneous files.
+        https://bugs.webkit.org/show_bug.cgi?id=165102
+
+        Reviewed by Saam Barati.
+
+        * wasm/js/WebAssemblyInstanceConstructor.cpp:
+        (JSC::constructJSWebAssemblyInstance):
+
+2016-11-28  Mark Lam  <mark....@apple.com>
+
         Fix exception scope verification failures in runtime/Weak* files.
         https://bugs.webkit.org/show_bug.cgi?id=165096
 

Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyInstanceConstructor.cpp (209024 => 209025)


--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyInstanceConstructor.cpp	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyInstanceConstructor.cpp	2016-11-28 22:56:08 UTC (rev 209025)
@@ -80,7 +80,9 @@
     VariableEnvironment declaredVariables;
     VariableEnvironment lexicalVariables;
     auto* moduleRecord = JSModuleRecord::create(state, vm, globalObject->moduleRecordStructure(), moduleKey, sourceCode, declaredVariables, lexicalVariables);
+    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     auto* moduleNamespaceObject = JSModuleNamespaceObject::create(state, globalObject, globalObject->moduleNamespaceObjectStructure(), moduleRecord, instanceExports);
+    RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     auto* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), globalObject->WebAssemblyInstanceStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());

Modified: trunk/Source/WebCore/ChangeLog (209024 => 209025)


--- trunk/Source/WebCore/ChangeLog	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/WebCore/ChangeLog	2016-11-28 22:56:08 UTC (rev 209025)
@@ -1,3 +1,25 @@
+2016-11-28  Mark Lam  <mark....@apple.com>
+
+        Fix exception scope verification failures in more miscellaneous files.
+        https://bugs.webkit.org/show_bug.cgi?id=165102
+
+        Reviewed by Saam Barati.
+
+        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):
+
 2016-11-28  Dave Hyatt  <hy...@apple.com>
 
         [CSS Parser] Fix bugs in the @supports parser

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (209024 => 209025)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-11-28 22:56:08 UTC (rev 209025)
@@ -101,8 +101,10 @@
         unsigned size = inArray.size();
         auto outArray = constructEmptyArray(&state, 0, &globalObject, size);
         RETURN_IF_EXCEPTION(scope, JSValue());
-        for (size_t i = 0; i < size; ++i)
+        for (size_t i = 0; i < size; ++i) {
             outArray->putDirectIndex(&state, i, toJS(state, globalObject, inArray.at(i).get()));
+            RETURN_IF_EXCEPTION(scope, JSValue());
+        }
         return outArray;
     }
     case KeyType::Binary: {

Modified: trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp (209024 => 209025)


--- trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp	2016-11-28 22:56:08 UTC (rev 209025)
@@ -91,6 +91,7 @@
         listenerEntry->putDirect(vm, Identifier::fromString(&state, "listener"), function);
         listenerEntry->putDirect(vm, Identifier::fromString(&state, "useCapture"), jsBoolean(listenerInfo.eventListenerVector[i]->useCapture()));
         result->putDirectIndex(&state, outputIndex++, JSValue(listenerEntry));
+        RETURN_IF_EXCEPTION(scope, nullptr);
     }
     return result;
 }

Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (209024 => 209025)


--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp	2016-11-28 22:56:08 UTC (rev 209025)
@@ -571,6 +571,7 @@
         addToJSON(exec, jsPrimeInfo, "d", base64URLEncode(data.otherPrimeInfos()[i].factorCRTExponent));
         addToJSON(exec, jsPrimeInfo, "t", base64URLEncode(data.otherPrimeInfos()[i].factorCRTCoefficient));
         oth->putDirectIndex(exec, i, jsPrimeInfo);
+        RETURN_IF_EXCEPTION(scope, void());
     }
     result->putDirect(vm, Identifier::fromString(exec, "oth"), oth);
 }
@@ -694,22 +695,38 @@
     RETURN_IF_EXCEPTION(scope, void());
 
     unsigned index = 0;
-    if (usages & CryptoKeyUsageSign)
+    if (usages & CryptoKeyUsageSign) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("sign")));
-    if (usages & CryptoKeyUsageVerify)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageVerify) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("verify")));
-    if (usages & CryptoKeyUsageEncrypt)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageEncrypt) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("encrypt")));
-    if (usages & CryptoKeyUsageDecrypt)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageDecrypt) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("decrypt")));
-    if (usages & CryptoKeyUsageWrapKey)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageWrapKey) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("wrapKey")));
-    if (usages & CryptoKeyUsageUnwrapKey)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageUnwrapKey) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("unwrapKey")));
-    if (usages & CryptoKeyUsageDeriveKey)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageDeriveKey) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("deriveKey")));
-    if (usages & CryptoKeyUsageDeriveBits)
+        RETURN_IF_EXCEPTION(scope, void());
+    }
+    if (usages & CryptoKeyUsageDeriveBits) {
         keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("deriveBits")));
+        RETURN_IF_EXCEPTION(scope, void());
+    }
 
     json->putDirect(vm, Identifier::fromString(exec, "key_ops"), keyOps);
 }

Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (209024 => 209025)


--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2016-11-28 22:56:08 UTC (rev 209025)
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 1999-2001 Harri Porten (por...@kde.org)
- *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2013 Apple Inc. All rights reserved.
+ *  Copyright (C) 2003-2006, 2008-2009, 2013, 2016 Apple Inc. All rights reserved.
  *  Copyright (C) 2007 Samuel Weinig <s...@webkit.org>
  *  Copyright (C) 2009 Google, Inc. All rights reserved.
  *  Copyright (C) 2012 Ericsson AB. All rights reserved.
@@ -658,8 +658,10 @@
 
     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
     RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    for (size_t i = 0; i < vector.size(); ++i)
+    for (size_t i = 0; i < vector.size(); ++i) {
         array->putDirectIndex(exec, i, toJS(exec, globalObject, vector[i]));
+        RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    }
     return array;
 }
 
@@ -670,8 +672,10 @@
 
     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
     RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    for (size_t i = 0; i < vector.size(); ++i)
+    for (size_t i = 0; i < vector.size(); ++i) {
         array->putDirectIndex(exec, i, toJS(exec, globalObject, vector[i].get()));
+        RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    }
     return array;
 }
 

Modified: trunk/Source/WebCore/bridge/runtime_array.cpp (209024 => 209025)


--- trunk/Source/WebCore/bridge/runtime_array.cpp	2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/WebCore/bridge/runtime_array.cpp	2016-11-28 22:56:08 UTC (rev 209025)
@@ -127,7 +127,8 @@
     
     if (std::optional<uint32_t> index = parseIndex(propertyName))
         return thisObject->getConcreteArray()->setValueAt(exec, index.value(), value);
-    
+
+    scope.release();
     return JSObject::put(thisObject, exec, propertyName, value, slot);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to