Title: [243335] trunk/Source/_javascript_Core
Revision
243335
Author
[email protected]
Date
2019-03-21 15:04:56 -0700 (Thu, 21 Mar 2019)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (243334 => 243335)


--- trunk/Source/_javascript_Core/ChangeLog	2019-03-21 22:00:52 UTC (rev 243334)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-03-21 22:04:56 UTC (rev 243335)
@@ -1,3 +1,18 @@
+2019-03-21  Tadeu Zagallo  <[email protected]>
+
+        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):
+
 2019-03-21  Robin Morisset  <[email protected]>
 
         B3::Opcode can fit in a single byte, shrinking B3Value by 8 bytes

Modified: trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp (243334 => 243335)


--- trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2019-03-21 22:00:52 UTC (rev 243334)
+++ trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2019-03-21 22:04:56 UTC (rev 243335)
@@ -275,8 +275,11 @@
     auto scope = DECLARE_CATCH_SCOPE(vm);
 
     String valueDescription = errorDescriptionForValue(exec, value);
-    if (!valueDescription)
+    ASSERT(scope.exception() || !!valueDescription);
+    if (!valueDescription) {
+        scope.clearException();
         return createOutOfMemoryError(exec);
+    }
     String errorMessage = tryMakeString(valueDescription, ' ', message);
     if (!errorMessage)
         return createOutOfMemoryError(exec);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to