Changeset 252767 in webkit


Ignore:
Timestamp:
Nov 22, 2019, 3:32:43 AM (6 years ago)
Author:
mark.lam@apple.com
Message:

Fix missing exception check in replaceUsingStringSearch().
https://bugs.webkit.org/show_bug.cgi?id=204496

Reviewed by Yusuke Suzuki.

The CachedCall constructor can throw OutOfMemory or StackOverflow errors.
This was caught by existing JSC stress tests when we run with a debug build.

Also placate the exception check validator in $vm's functionCallWithStackSize().

  • runtime/StringPrototype.cpp:

(JSC::replaceUsingStringSearch):

  • tools/JSDollarVM.cpp:

(JSC::functionCallWithStackSize):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r252766 r252767  
     12019-11-22  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix missing exception check in replaceUsingStringSearch().
     4        https://bugs.webkit.org/show_bug.cgi?id=204496
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        The CachedCall constructor can throw OutOfMemory or StackOverflow errors.
     9        This was caught by existing JSC stress tests when we run with a debug build.
     10
     11        Also placate the exception check validator in $vm's functionCallWithStackSize().
     12
     13        * runtime/StringPrototype.cpp:
     14        (JSC::replaceUsingStringSearch):
     15        * tools/JSDollarVM.cpp:
     16        (JSC::functionCallWithStackSize):
     17
    1182019-11-21  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r252766 r252767  
    796796    } else if (callType == CallType::JS) {
    797797        cachedCall.emplace(globalObject, callFrame, jsCast<JSFunction*>(replaceValue), 3);
     798        RETURN_IF_EXCEPTION(scope, nullptr);
    798799        cachedCall->setThis(jsUndefined());
    799800    }
  • trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp

    r252756 r252767  
    21032103    RELEASE_ASSERT(vm.stackLimit() == originalVMStackLimit);
    21042104
     2105    throwScope.release();
    21052106    return encodedJSUndefined();
    21062107
Note: See TracChangeset for help on using the changeset viewer.