⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243335 in webkit


Ignore:
Timestamp:
Mar 21, 2019, 3:04:56 PM (7 years ago)
Author:
Tadeu Zagallo
Message:

JSC::createError should clear exception thrown by errorDescriptionForValue
https://bugs.webkit.org/show_bug.cgi?id=196089

Reviewed by Mark Lam.

errorDescriptionForValue returns a nullString in case of failure, but it
might also throw an OOM exception when resolving a rope string. We need
to clear any potential exceptions thrown by errorDescriptionForValue
before returning the OOM from JSC::createError.

  • runtime/ExceptionHelpers.cpp:

(JSC::createError):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r243330 r243335  
     12019-03-21  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        JSC::createError should clear exception thrown by errorDescriptionForValue
     4        https://bugs.webkit.org/show_bug.cgi?id=196089
     5
     6        Reviewed by Mark Lam.
     7
     8        errorDescriptionForValue returns a nullString in case of failure, but it
     9        might also throw an OOM exception when resolving a rope string. We need
     10        to clear any potential exceptions thrown by errorDescriptionForValue
     11        before returning the OOM from JSC::createError.
     12
     13        * runtime/ExceptionHelpers.cpp:
     14        (JSC::createError):
     15
    1162019-03-21  Robin Morisset  <rmorisset@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r243246 r243335  
    276276
    277277    String valueDescription = errorDescriptionForValue(exec, value);
    278     if (!valueDescription)
     278    ASSERT(scope.exception() || !!valueDescription);
     279    if (!valueDescription) {
     280        scope.clearException();
    279281        return createOutOfMemoryError(exec);
     282    }
    280283    String errorMessage = tryMakeString(valueDescription, ' ', message);
    281284    if (!errorMessage)
Note: See TracChangeset for help on using the changeset viewer.