<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209025] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209025">209025</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-11-28 14:56:08 -0800 (Mon, 28 Nov 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>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):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyInstanceConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCommandLineAPIHostCustomcpp">trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp">trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebridgeruntime_arraycpp">trunk/Source/WebCore/bridge/runtime_array.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-11-28 22:56:08 UTC (rev 209025)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2016-11-28 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><ins>+ 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.lam@apple.com>
+
</ins><span class="cx"> Fix exception scope verification failures in runtime/Weak* files.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=165096
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyInstanceConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp        2016-11-28 22:41:23 UTC (rev 209024)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp        2016-11-28 22:56:08 UTC (rev 209025)
</span><span class="lines">@@ -80,7 +80,9 @@
</span><span class="cx"> VariableEnvironment declaredVariables;
</span><span class="cx"> VariableEnvironment lexicalVariables;
</span><span class="cx"> auto* moduleRecord = JSModuleRecord::create(state, vm, globalObject->moduleRecordStructure(), moduleKey, sourceCode, declaredVariables, lexicalVariables);
</span><ins>+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
</ins><span class="cx"> auto* moduleNamespaceObject = JSModuleNamespaceObject::create(state, globalObject, globalObject->moduleNamespaceObjectStructure(), moduleRecord, instanceExports);
</span><ins>+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
</ins><span class="cx">
</span><span class="cx"> auto* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), globalObject->WebAssemblyInstanceStructure());
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, encodedJSValue());
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-11-28 Mark Lam <mark.lam@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):
+
</ins><span class="cx"> 2016-11-28 Dave Hyatt <hyatt@apple.com>
</span><span class="cx">
</span><span class="cx"> [CSS Parser] Fix bugs in the @supports parser
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -101,8 +101,10 @@
</span><span class="cx"> unsigned size = inArray.size();
</span><span class="cx"> auto outArray = constructEmptyArray(&state, 0, &globalObject, size);
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>- for (size_t i = 0; i < size; ++i)
</del><ins>+ for (size_t i = 0; i < size; ++i) {
</ins><span class="cx"> outArray->putDirectIndex(&state, i, toJS(state, globalObject, inArray.at(i).get()));
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+ }
</ins><span class="cx"> return outArray;
</span><span class="cx"> }
</span><span class="cx"> case KeyType::Binary: {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCommandLineAPIHostCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> listenerEntry->putDirect(vm, Identifier::fromString(&state, "listener"), function);
</span><span class="cx"> listenerEntry->putDirect(vm, Identifier::fromString(&state, "useCapture"), jsBoolean(listenerInfo.eventListenerVector[i]->useCapture()));
</span><span class="cx"> result->putDirectIndex(&state, outputIndex++, JSValue(listenerEntry));
</span><ins>+ RETURN_IF_EXCEPTION(scope, nullptr);
</ins><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -571,6 +571,7 @@
</span><span class="cx"> addToJSON(exec, jsPrimeInfo, "d", base64URLEncode(data.otherPrimeInfos()[i].factorCRTExponent));
</span><span class="cx"> addToJSON(exec, jsPrimeInfo, "t", base64URLEncode(data.otherPrimeInfos()[i].factorCRTCoefficient));
</span><span class="cx"> oth->putDirectIndex(exec, i, jsPrimeInfo);
</span><ins>+ RETURN_IF_EXCEPTION(scope, void());
</ins><span class="cx"> }
</span><span class="cx"> result->putDirect(vm, Identifier::fromString(exec, "oth"), oth);
</span><span class="cx"> }
</span><span class="lines">@@ -694,22 +695,38 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, void());
</span><span class="cx">
</span><span class="cx"> unsigned index = 0;
</span><del>- if (usages & CryptoKeyUsageSign)
</del><ins>+ if (usages & CryptoKeyUsageSign) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("sign")));
</span><del>- if (usages & CryptoKeyUsageVerify)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageVerify) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("verify")));
</span><del>- if (usages & CryptoKeyUsageEncrypt)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageEncrypt) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("encrypt")));
</span><del>- if (usages & CryptoKeyUsageDecrypt)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageDecrypt) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("decrypt")));
</span><del>- if (usages & CryptoKeyUsageWrapKey)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageWrapKey) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("wrapKey")));
</span><del>- if (usages & CryptoKeyUsageUnwrapKey)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageUnwrapKey) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("unwrapKey")));
</span><del>- if (usages & CryptoKeyUsageDeriveKey)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageDeriveKey) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("deriveKey")));
</span><del>- if (usages & CryptoKeyUsageDeriveBits)
</del><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ if (usages & CryptoKeyUsageDeriveBits) {
</ins><span class="cx"> keyOps->putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral("deriveBits")));
</span><ins>+ RETURN_IF_EXCEPTION(scope, void());
+ }
</ins><span class="cx">
</span><span class="cx"> json->putDirect(vm, Identifier::fromString(exec, "key_ops"), keyOps);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
</span><del>- * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2006, 2008-2009, 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
</span><span class="cx"> * Copyright (C) 2009 Google, Inc. All rights reserved.
</span><span class="cx"> * Copyright (C) 2012 Ericsson AB. All rights reserved.
</span><span class="lines">@@ -658,8 +658,10 @@
</span><span class="cx">
</span><span class="cx"> JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSC::JSValue());
</span><del>- for (size_t i = 0; i < vector.size(); ++i)
</del><ins>+ for (size_t i = 0; i < vector.size(); ++i) {
</ins><span class="cx"> array->putDirectIndex(exec, i, toJS(exec, globalObject, vector[i]));
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+ }
</ins><span class="cx"> return array;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -670,8 +672,10 @@
</span><span class="cx">
</span><span class="cx"> JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSC::JSValue());
</span><del>- for (size_t i = 0; i < vector.size(); ++i)
</del><ins>+ for (size_t i = 0; i < vector.size(); ++i) {
</ins><span class="cx"> array->putDirectIndex(exec, i, toJS(exec, globalObject, vector[i].get()));
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+ }
</ins><span class="cx"> return array;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeruntime_arraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/runtime_array.cpp (209024 => 209025)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -127,7 +127,8 @@
</span><span class="cx">
</span><span class="cx"> if (std::optional<uint32_t> index = parseIndex(propertyName))
</span><span class="cx"> return thisObject->getConcreteArray()->setValueAt(exec, index.value(), value);
</span><del>-
</del><ins>+
+ scope.release();
</ins><span class="cx"> return JSObject::put(thisObject, exec, propertyName, value, slot);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>