Changeset 248716 in webkit


Ignore:
Timestamp:
Aug 15, 2019 9:31:19 AM (5 years ago)
Author:
mark.lam@apple.com
Message:

More missing exception checks in String.prototype.
https://bugs.webkit.org/show_bug.cgi?id=200762
<rdar://problem/54333896>

Reviewed by Michael Saboff.

JSTests:

  • stress/missing-exception-check-in-string-lastIndexOf.js: Added.
  • stress/missing-exception-check-in-string-toLower.js: Added.
  • stress/missing-exception-check-in-string-toUpper.js: Added.

Source/JavaScriptCore:

  • runtime/StringPrototype.cpp:

(JSC::replaceUsingRegExpSearch):
(JSC::operationStringProtoFuncReplaceRegExpString):
(JSC::stringProtoFuncLastIndexOf):
(JSC::stringProtoFuncToLowerCase):
(JSC::stringProtoFuncToUpperCase):

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r248709 r248716  
     12019-08-15  Mark Lam  <mark.lam@apple.com>
     2
     3        More missing exception checks in String.prototype.
     4        https://bugs.webkit.org/show_bug.cgi?id=200762
     5        <rdar://problem/54333896>
     6
     7        Reviewed by Michael Saboff.
     8
     9        * stress/missing-exception-check-in-string-lastIndexOf.js: Added.
     10        * stress/missing-exception-check-in-string-toLower.js: Added.
     11        * stress/missing-exception-check-in-string-toUpper.js: Added.
     12
    1132019-08-14  Mark Lam  <mark.lam@apple.com>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r248711 r248716  
     12019-08-15  Mark Lam  <mark.lam@apple.com>
     2
     3        More missing exception checks in String.prototype.
     4        https://bugs.webkit.org/show_bug.cgi?id=200762
     5        <rdar://problem/54333896>
     6
     7        Reviewed by Michael Saboff.
     8
     9        * runtime/StringPrototype.cpp:
     10        (JSC::replaceUsingRegExpSearch):
     11        (JSC::operationStringProtoFuncReplaceRegExpString):
     12        (JSC::stringProtoFuncLastIndexOf):
     13        (JSC::stringProtoFuncToLowerCase):
     14        (JSC::stringProtoFuncToUpperCase):
     15
    1162019-08-15  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r246780 r248716  
    530530
    531531    String source = string->value(exec);
     532    RETURN_IF_EXCEPTION(scope, nullptr);
    532533    unsigned sourceLen = source.length();
    533534    RETURN_IF_EXCEPTION(scope, nullptr);
     
    755756    VM& vm = exec->vm();
    756757    NativeCallFrameTracer tracer(&vm, exec);
    757    
     758    auto scope = DECLARE_THROW_SCOPE(vm);
     759
    758760    CallData callData;
    759761    String replacementString = replaceString->value(exec);
    760     return replaceUsingRegExpSearch(
    761         vm, exec, thisValue, searchValue, callData, CallType::None, replacementString, replaceString);
     762    RETURN_IF_EXCEPTION(scope, nullptr);
     763    RELEASE_AND_RETURN(scope, replaceUsingRegExpSearch(
     764        vm, exec, thisValue, searchValue, callData, CallType::None, replacementString, replaceString));
    762765}
    763766
     
    11261129
    11271130    String thisString = thisJSString->value(exec);
     1131    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    11281132    String otherString = otherJSString->value(exec);
     1133    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    11291134    size_t result;
    11301135    if (!startPosition)
     
    14471452    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    14481453    String s = sVal->value(exec);
     1454    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    14491455    String lowercasedString = s.convertToLowercaseWithoutLocale();
    14501456    if (lowercasedString.impl() == s.impl())
     
    14641470    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    14651471    String s = sVal->value(exec);
     1472    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    14661473    String uppercasedString = s.convertToUppercaseWithoutLocale();
    14671474    if (uppercasedString.impl() == s.impl())
Note: See TracChangeset for help on using the changeset viewer.