Title: [209026] trunk/Source/_javascript_Core
- Revision
- 209026
- Author
- [email protected]
- Date
- 2016-11-28 15:00:38 -0800 (Mon, 28 Nov 2016)
Log Message
Fix exception scope verification failures in runtime/Map* files.
https://bugs.webkit.org/show_bug.cgi?id=165050
Reviewed by Saam Barati.
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototypeFuncNext):
* runtime/MapPrototype.cpp:
(JSC::privateFuncMapIteratorNext):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (209025 => 209026)
--- trunk/Source/_javascript_Core/ChangeLog 2016-11-28 22:56:08 UTC (rev 209025)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-11-28 23:00:38 UTC (rev 209026)
@@ -1,5 +1,19 @@
2016-11-28 Mark Lam <[email protected]>
+ Fix exception scope verification failures in runtime/Map* files.
+ https://bugs.webkit.org/show_bug.cgi?id=165050
+
+ Reviewed by Saam Barati.
+
+ * runtime/MapConstructor.cpp:
+ (JSC::constructMap):
+ * runtime/MapIteratorPrototype.cpp:
+ (JSC::MapIteratorPrototypeFuncNext):
+ * runtime/MapPrototype.cpp:
+ (JSC::privateFuncMapIteratorNext):
+
+2016-11-28 Mark Lam <[email protected]>
+
Fix exception scope verification failures in more miscellaneous files.
https://bugs.webkit.org/show_bug.cgi?id=165102
Modified: trunk/Source/_javascript_Core/runtime/MapConstructor.cpp (209025 => 209026)
--- trunk/Source/_javascript_Core/runtime/MapConstructor.cpp 2016-11-28 22:56:08 UTC (rev 209025)
+++ trunk/Source/_javascript_Core/runtime/MapConstructor.cpp 2016-11-28 23:00:38 UTC (rev 209026)
@@ -76,6 +76,7 @@
if (adderFunctionCallType == CallType::None)
return JSValue::encode(throwTypeError(exec, scope));
+ scope.release();
forEachInIterable(exec, iterable, [&](VM& vm, ExecState* exec, JSValue nextItem) {
auto scope = DECLARE_THROW_SCOPE(vm);
if (!nextItem.isObject()) {
@@ -92,6 +93,7 @@
MarkedArgumentBuffer arguments;
arguments.append(key);
arguments.append(value);
+ scope.release();
call(exec, adderFunction, adderFunctionCallType, adderFunctionCallData, map, arguments);
});
Modified: trunk/Source/_javascript_Core/runtime/MapIteratorPrototype.cpp (209025 => 209026)
--- trunk/Source/_javascript_Core/runtime/MapIteratorPrototype.cpp 2016-11-28 22:56:08 UTC (rev 209025)
+++ trunk/Source/_javascript_Core/runtime/MapIteratorPrototype.cpp 2016-11-28 23:00:38 UTC (rev 209026)
@@ -56,8 +56,11 @@
return JSValue::encode(throwTypeError(callFrame, scope, ASCIILiteral("Cannot call MapIterator.next() on a non-MapIterator object")));
JSValue result;
- if (iterator->next(callFrame, result))
+ if (iterator->next(callFrame, result)) {
+ scope.release();
return JSValue::encode(createIteratorResultObject(callFrame, result, false));
+ }
+ scope.release();
return JSValue::encode(createIteratorResultObject(callFrame, jsUndefined(), true));
}
Modified: trunk/Source/_javascript_Core/runtime/MapPrototype.cpp (209025 => 209026)
--- trunk/Source/_javascript_Core/runtime/MapPrototype.cpp 2016-11-28 22:56:08 UTC (rev 209025)
+++ trunk/Source/_javascript_Core/runtime/MapPrototype.cpp 2016-11-28 23:00:38 UTC (rev 209026)
@@ -192,6 +192,8 @@
EncodedJSValue JSC_HOST_CALL privateFuncMapIteratorNext(ExecState* exec)
{
+ VM& vm = exec->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
ASSERT(jsDynamicCast<JSMapIterator*>(exec->thisValue()));
JSMapIterator* iterator = jsCast<JSMapIterator*>(exec->thisValue());
JSValue key, value;
@@ -198,6 +200,8 @@
if (iterator->nextKeyValue(exec, key, value)) {
JSArray* resultArray = jsCast<JSArray*>(exec->uncheckedArgument(0));
resultArray->putDirectIndex(exec, 0, key);
+ RETURN_IF_EXCEPTION(scope, encodedJSValue());
+ scope.release();
resultArray->putDirectIndex(exec, 1, value);
return JSValue::encode(jsBoolean(false));
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes