Title: [233998] trunk/Source/_javascript_Core
Revision
233998
Author
[email protected]
Date
2018-07-19 12:28:08 -0700 (Thu, 19 Jul 2018)

Log Message

Temporarily mitigate a bug where a source provider is null when it shouldn't be.
https://bugs.webkit.org/show_bug.cgi?id=187812
<rdar://problem/41192691>

Reviewed by Michael Saboff.

Adding a null check to temporarily mitigate https://bugs.webkit.org/show_bug.cgi?id=187811.

* runtime/Error.cpp:
(JSC::addErrorInfo):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (233997 => 233998)


--- trunk/Source/_javascript_Core/ChangeLog	2018-07-19 19:21:29 UTC (rev 233997)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-07-19 19:28:08 UTC (rev 233998)
@@ -1,3 +1,16 @@
+2018-07-19  Mark Lam  <[email protected]>
+
+        Temporarily mitigate a bug where a source provider is null when it shouldn't be.
+        https://bugs.webkit.org/show_bug.cgi?id=187812
+        <rdar://problem/41192691>
+
+        Reviewed by Michael Saboff.
+
+        Adding a null check to temporarily mitigate https://bugs.webkit.org/show_bug.cgi?id=187811.
+
+        * runtime/Error.cpp:
+        (JSC::addErrorInfo):
+
 2018-07-19  Keith Rollin  <[email protected]>
 
         Adjust WEBCORE_EXPORT annotations for LTO

Modified: trunk/Source/_javascript_Core/runtime/Error.cpp (233997 => 233998)


--- trunk/Source/_javascript_Core/runtime/Error.cpp	2018-07-19 19:21:29 UTC (rev 233997)
+++ trunk/Source/_javascript_Core/runtime/Error.cpp	2018-07-19 19:28:08 UTC (rev 233998)
@@ -239,7 +239,6 @@
 JSObject* addErrorInfo(CallFrame* callFrame, JSObject* error, int line, const SourceCode& source)
 {
     VM& vm = callFrame->vm();
-    const String& sourceURL = source.provider()->url();
     
     // The putDirect() calls below should really be put() so that they trigger materialization of
     // the line/sourceURL properties. Otherwise, what we set here will just be overwritten later.
@@ -256,8 +255,15 @@
     // https://bugs.webkit.org/show_bug.cgi?id=176673
     if (line != -1)
         error->putDirect(vm, vm.propertyNames->line, jsNumber(line));
-    if (!sourceURL.isNull())
-        error->putDirect(vm, vm.propertyNames->sourceURL, jsString(&vm, sourceURL));
+
+    SourceProvider* provider = source.provider();
+    // FIXME: Remove this ASSERT and null check when https://webkit.org/b/187811 is fixed.
+    ASSERT(provider);
+    if (LIKELY(provider)) {
+        const String& sourceURL = provider->url();
+        if (!sourceURL.isNull())
+            error->putDirect(vm, vm.propertyNames->sourceURL, jsString(&vm, sourceURL));
+    }
     return error;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to