Changeset 106600 in webkit


Ignore:
Timestamp:
Feb 2, 2012 3:42:26 PM (12 years ago)
Author:
benjamin@webkit.org
Message:

Running a Web Worker on about:blank crashes the interpreter
https://bugs.webkit.org/show_bug.cgi?id=77593

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-02-02
Reviewed by Michael Saboff.

Source/JavaScriptCore:

The method Interpreter::execute() was crashing on empty programs because
the assumption is made the source is not null.

This patch shortcut the execution when the String is null to avoid invalid
memory access.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):

LayoutTests:

The Worker thread should not crash if running on an empty page.
The timer is necessary to give a chance for the thread to start.

  • fast/workers/empty-worker-nocrash-expected.txt: Added.
  • fast/workers/empty-worker-nocrash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106596 r106600  
     12012-02-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Running a Web Worker on about:blank crashes the interpreter
     4        https://bugs.webkit.org/show_bug.cgi?id=77593
     5
     6        Reviewed by Michael Saboff.
     7
     8        The Worker thread should not crash if running on an empty page.
     9        The timer is necessary to give a chance for the thread to start.
     10
     11        * fast/workers/empty-worker-nocrash-expected.txt: Added.
     12        * fast/workers/empty-worker-nocrash.html: Added.
     13
    1142012-02-02  Filip Pizlo  <fpizlo@apple.com>
    215
  • trunk/Source/JavaScriptCore/ChangeLog

    r106598 r106600  
     12012-02-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Running a Web Worker on about:blank crashes the interpreter
     4        https://bugs.webkit.org/show_bug.cgi?id=77593
     5
     6        Reviewed by Michael Saboff.
     7
     8        The method Interpreter::execute() was crashing on empty programs because
     9        the assumption is made the source is not null.
     10
     11        This patch shortcut the execution when the String is null to avoid invalid
     12        memory access.
     13
     14        * interpreter/Interpreter.cpp:
     15        (JSC::Interpreter::execute):
     16
    1172012-02-02  Kalev Lember  <kalevlember@gmail.com>
    218
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r106596 r106600  
    886886    bool parseResult;
    887887    const UString programSource = program->source().toString();
     888    if (programSource.isNull())
     889        return jsUndefined();
    888890    if (programSource.is8Bit()) {
    889891        LiteralParser<LChar> literalParser(callFrame, programSource.characters8(), programSource.length(), JSONP);
Note: See TracChangeset for help on using the changeset viewer.