Changeset 251411 in webkit


Ignore:
Timestamp:
Oct 21, 2019 6:55:20 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Fix incorrect assertion in operationRegExpExecNonGlobalOrSticky().
https://bugs.webkit.org/show_bug.cgi?id=203230
<rdar://problem/56460749>

Reviewed by Robin Morisset.

JSTests:

  • stress/incorrect-exception-assertion-in-operationRegExpExecNonGlobalOrSticky.js: Added.

Source/JavaScriptCore:

operationRegExpExecNonGlobalOrSticky() was asserting no exception when
createRegExpMatchesArray() returns null. createRegExpMatchesArray() only returns
null when RegExp::matchInline() returns -1. The only way RegExp::matchInline()
can return -1 is via a throwError() helper which throws an exception. The other
return path in RegExp::matchInline() explicitly ASSERT(result >= -1). Hence, the
assertion in operationRegExpExecNonGlobalOrSticky() is wrong.

  • dfg/DFGOperations.cpp:
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r251408 r251411  
     12019-10-21  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix incorrect assertion in operationRegExpExecNonGlobalOrSticky().
     4        https://bugs.webkit.org/show_bug.cgi?id=203230
     5        <rdar://problem/56460749>
     6
     7        Reviewed by Robin Morisset.
     8
     9        * stress/incorrect-exception-assertion-in-operationRegExpExecNonGlobalOrSticky.js: Added.
     10
    1112019-10-21  Saam Barati  <sbarati@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r251408 r251411  
     12019-10-21  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix incorrect assertion in operationRegExpExecNonGlobalOrSticky().
     4        https://bugs.webkit.org/show_bug.cgi?id=203230
     5        <rdar://problem/56460749>
     6
     7        Reviewed by Robin Morisset.
     8
     9        operationRegExpExecNonGlobalOrSticky() was asserting no exception when
     10        createRegExpMatchesArray() returns null.  createRegExpMatchesArray() only returns
     11        null when RegExp::matchInline() returns -1.  The only way RegExp::matchInline()
     12        can return -1 is via a throwError() helper which throws an exception.  The other
     13        return path in RegExp::matchInline() explicitly ASSERT(result >= -1).  Hence, the
     14        assertion in operationRegExpExecNonGlobalOrSticky() is wrong.
     15
     16        * dfg/DFGOperations.cpp:
     17
    1182019-10-21  Saam Barati  <sbarati@apple.com>
    219
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r250630 r251411  
    12461246    MatchResult result;
    12471247    JSArray* array = createRegExpMatchesArray(vm, globalObject, string, input, regExp, lastIndex, result);
    1248     if (!array) {
    1249         ASSERT(!scope.exception());
    1250         return JSValue::encode(jsNull());
    1251     }
    1252 
    12531248    RETURN_IF_EXCEPTION(scope, { });
     1249    ASSERT(array);
     1250
    12541251    globalObject->regExpGlobalData().recordMatch(vm, globalObject, regExp, string, result);
    12551252    return JSValue::encode(array);
Note: See TracChangeset for help on using the changeset viewer.