Changeset 189295 in webkit


Ignore:
Timestamp:
Sep 3, 2015 3:28:55 PM (9 years ago)
Author:
BJ Burg
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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r189293 r189295  
     12015-09-03  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: should crash on purpose if InjectedScriptSource.js is unparseable
     4        https://bugs.webkit.org/show_bug.cgi?id=148750
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        If an injected script cannot be parsed or executed without exception, we should abort as
     9        soon as possible. This patch adds a release assertion after creating the injected
     10        script and dumps the bad injected script's source as it was embedded into the binary.
     11
     12        * inspector/InjectedScriptManager.cpp:
     13        (Inspector::InjectedScriptManager::injectedScriptFor):
     14
    1152015-09-03  Basile Clement  <basile_clement@apple.com> and Michael Saboff  <msaboff@apple.com>
    216
  • trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp

    r185608 r189295  
    178178    int id = injectedScriptIdFor(inspectedExecState);
    179179    Deprecated::ScriptObject injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id);
     180    if (injectedScriptObject.scriptState() != inspectedExecState) {
     181        WTFLogAlways("Failed to parse/execute InjectedScriptSource.js!");
     182        WTFLogAlways("%s\n", injectedScriptSource().ascii().data());
     183        RELEASE_ASSERT_NOT_REACHED();
     184    }
     185
    180186    InjectedScript result(injectedScriptObject, &m_environment);
    181187    m_idToInjectedScript.set(id, result);
Note: See TracChangeset for help on using the changeset viewer.