Title: [238453] trunk/Source/_javascript_Core
Revision
238453
Author
mark....@apple.com
Date
2018-11-22 17:33:40 -0800 (Thu, 22 Nov 2018)

Log Message

Make the jsc shell's dumpException() more robust against long exception strings.
https://bugs.webkit.org/show_bug.cgi?id=191910
<rdar://problem/46212980>

Reviewed by Michael Saboff.

This only affects the dumping of the exception string in the jsc shell due to
unhandled exceptions or exceptions at shell boot time before any JS code is
running.

* jsc.cpp:
(dumpException):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (238452 => 238453)


--- trunk/Source/_javascript_Core/ChangeLog	2018-11-22 23:47:33 UTC (rev 238452)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-11-23 01:33:40 UTC (rev 238453)
@@ -1,3 +1,18 @@
+2018-11-22  Mark Lam  <mark....@apple.com>
+
+        Make the jsc shell's dumpException() more robust against long exception strings.
+        https://bugs.webkit.org/show_bug.cgi?id=191910
+        <rdar://problem/46212980>
+
+        Reviewed by Michael Saboff.
+
+        This only affects the dumping of the exception string in the jsc shell due to
+        unhandled exceptions or exceptions at shell boot time before any JS code is
+        running.
+
+        * jsc.cpp:
+        (dumpException):
+
 2018-11-21  Yusuke Suzuki  <yusukesuz...@slowstart.org>
 
         [JSC] Drop ARM_TRADITIONAL support in LLInt, baseline JIT, and DFG

Modified: trunk/Source/_javascript_Core/jsc.cpp (238452 => 238453)


--- trunk/Source/_javascript_Core/jsc.cpp	2018-11-22 23:47:33 UTC (rev 238452)
+++ trunk/Source/_javascript_Core/jsc.cpp	2018-11-23 01:33:40 UTC (rev 238453)
@@ -2302,7 +2302,12 @@
         } \
     } while (false)
 
-    printf("Exception: %s\n", exception.toWTFString(globalObject->globalExec()).utf8().data());
+    auto exceptionString = exception.toWTFString(globalObject->globalExec());
+    Expected<CString, UTF8ConversionError> expectedCString = exceptionString.tryGetUtf8();
+    if (expectedCString)
+        printf("Exception: %s\n", expectedCString.value().data());
+    else
+        printf("Exception: <out of memory while extracting exception string>\n");
 
     Identifier nameID = Identifier::fromString(globalObject->globalExec(), "name");
     CHECK_EXCEPTION();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to