Changeset 209026 in webkit


Ignore:
Timestamp:
Nov 28, 2016 3:00:38 PM (7 years ago)
Author:
mark.lam@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209025 r209026  
     12016-11-28  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix exception scope verification failures in runtime/Map* files.
     4        https://bugs.webkit.org/show_bug.cgi?id=165050
     5
     6        Reviewed by Saam Barati.
     7
     8        * runtime/MapConstructor.cpp:
     9        (JSC::constructMap):
     10        * runtime/MapIteratorPrototype.cpp:
     11        (JSC::MapIteratorPrototypeFuncNext):
     12        * runtime/MapPrototype.cpp:
     13        (JSC::privateFuncMapIteratorNext):
     14
    1152016-11-28  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp

    r206386 r209026  
    7777        return JSValue::encode(throwTypeError(exec, scope));
    7878
     79    scope.release();
    7980    forEachInIterable(exec, iterable, [&](VM& vm, ExecState* exec, JSValue nextItem) {
    8081        auto scope = DECLARE_THROW_SCOPE(vm);
     
    9394        arguments.append(key);
    9495        arguments.append(value);
     96        scope.release();
    9597        call(exec, adderFunction, adderFunctionCallType, adderFunctionCallData, map, arguments);
    9698    });
  • trunk/Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp

    r205520 r209026  
    5757
    5858    JSValue result;
    59     if (iterator->next(callFrame, result))
     59    if (iterator->next(callFrame, result)) {
     60        scope.release();
    6061        return JSValue::encode(createIteratorResultObject(callFrame, result, false));
     62    }
     63    scope.release();
    6164    return JSValue::encode(createIteratorResultObject(callFrame, jsUndefined(), true));
    6265}
  • trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp

    r206267 r209026  
    193193EncodedJSValue JSC_HOST_CALL privateFuncMapIteratorNext(ExecState* exec)
    194194{
     195    VM& vm = exec->vm();
     196    auto scope = DECLARE_THROW_SCOPE(vm);
    195197    ASSERT(jsDynamicCast<JSMapIterator*>(exec->thisValue()));
    196198    JSMapIterator* iterator = jsCast<JSMapIterator*>(exec->thisValue());
     
    199201        JSArray* resultArray = jsCast<JSArray*>(exec->uncheckedArgument(0));
    200202        resultArray->putDirectIndex(exec, 0, key);
     203        RETURN_IF_EXCEPTION(scope, encodedJSValue());
     204        scope.release();
    201205        resultArray->putDirectIndex(exec, 1, value);
    202206        return JSValue::encode(jsBoolean(false));
Note: See TracChangeset for help on using the changeset viewer.