Ignore:
Timestamp:
Feb 14, 2008, 3:29:51 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Sam Weinig.


Fixed <rdar://problem/5737835> nee http://bugs.webkit.org/show_bug.cgi?id=17329
Crash in JSGlobalObject::popActivation when inserting hyperlink in Wordpress (17329)


Don't reset the "activations" stack in JSGlobalObject::reset, since we
might be executing a script during the call to reset, and the script
needs to safely run to completion.


Instead, initialize the "activations" stack when the global object is
created, and subsequently rely on pushing and popping during normal
execution to maintain the stack's state.


  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): (KJS::JSGlobalObject::reset):

LayoutTests:

Reviewed by Sam Weinig.


Layout test for <rdar://problem/5737835> nee http://bugs.webkit.org/show_bug.cgi?id=17329
Crash in JSGlobalObject::popActivation when inserting hyperlink in Wordpress (17329)


  • fast/dom/javascript-url-crash-function.html: Added.
  • fast/dom/javascript-url-crash-function-expected.txt: Added.
  • fast/dom/resources/javascript-url-crash-function-iframe.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSGlobalObject.cpp

    r30102 r30235  
    140140    d()->debugger = 0;
    141141   
    142     d()->activations = 0;
    143    
     142    ActivationStackNode* newStackNode = new ActivationStackNode;
     143    newStackNode->prev = 0;   
     144    d()->activations = newStackNode;
     145    d()->activationCount = 0;
     146
    144147    reset(prototype());
    145148}
     
    215218
    216219    ExecState* exec = &d()->globalExec;
    217 
    218     deleteActivationStack();
    219     ActivationStackNode* newStackNode = new ActivationStackNode;
    220     newStackNode->prev = 0;   
    221     d()->activations = newStackNode;
    222     d()->activationCount = 0;
    223220
    224221    // Prototypes
     
    531528    if (!d()->activationCount) {
    532529        ActivationStackNode* prev = d()->activations->prev;
     530        ASSERT(prev);
    533531        delete d()->activations;
    534532        d()->activations = prev;
Note: See TracChangeset for help on using the changeset viewer.