Title: [189295] trunk/Source/_javascript_Core
Revision
189295
Author
[email protected]
Date
2015-09-03 15:28:55 -0700 (Thu, 03 Sep 2015)

Log Message

Web Inspector: should crash on purpose if InjectedScriptSource.js is unparseable
https://bugs.webkit.org/show_bug.cgi?id=148750

Reviewed by Timothy Hatcher.

If an injected script cannot be parsed or executed without exception, we should abort as
soon as possible. This patch adds a release assertion after creating the injected
script and dumps the bad injected script's source as it was embedded into the binary.

* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::injectedScriptFor):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (189294 => 189295)


--- trunk/Source/_javascript_Core/ChangeLog	2015-09-03 22:26:47 UTC (rev 189294)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-09-03 22:28:55 UTC (rev 189295)
@@ -1,3 +1,17 @@
+2015-09-03  Brian Burg  <[email protected]>
+
+        Web Inspector: should crash on purpose if InjectedScriptSource.js is unparseable
+        https://bugs.webkit.org/show_bug.cgi?id=148750
+
+        Reviewed by Timothy Hatcher.
+
+        If an injected script cannot be parsed or executed without exception, we should abort as
+        soon as possible. This patch adds a release assertion after creating the injected
+        script and dumps the bad injected script's source as it was embedded into the binary.
+
+        * inspector/InjectedScriptManager.cpp:
+        (Inspector::InjectedScriptManager::injectedScriptFor):
+
 2015-09-03  Basile Clement  <[email protected]> and Michael Saboff  <[email protected]>
 
         Clean up register naming

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp (189294 => 189295)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp	2015-09-03 22:26:47 UTC (rev 189294)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp	2015-09-03 22:28:55 UTC (rev 189295)
@@ -177,6 +177,12 @@
 
     int id = injectedScriptIdFor(inspectedExecState);
     Deprecated::ScriptObject injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id);
+    if (injectedScriptObject.scriptState() != inspectedExecState) {
+        WTFLogAlways("Failed to parse/execute InjectedScriptSource.js!");
+        WTFLogAlways("%s\n", injectedScriptSource().ascii().data());
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+
     InjectedScript result(injectedScriptObject, &m_environment);
     m_idToInjectedScript.set(id, result);
     didCreateInjectedScript(result);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to