Ignore:
Timestamp:
Jan 6, 2009, 12:33:54 PM (16 years ago)
Author:
[email protected]
Message:

<https://bugs.webkit.org/show_bug.cgi?id=23085> [jsfunfuzz] Over released ScopeChainNode
<rdar://problem/6474110>

Reviewed by Cameron Zwarich

So this delightful bug was caused by our unwind code using a ScopeChain to perform
the unwind. The ScopeChain would ref the initial top of the scope chain, then deref
the resultant top of scope chain, which is incorrect.

This patch removes the dependency on ScopeChain for the unwind, and i've filed
<https://bugs.webkit.org/show_bug.cgi?id=23144> to look into the unintuitive
ScopeChain behaviour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r39631 r39660  
    851851    // Now unwind the scope chain within the exception handler's call frame.
    852852
    853     ScopeChain sc(callFrame->scopeChain());
     853    ScopeChainNode* scopeChain = callFrame->scopeChain();
     854    ScopeChain sc(scopeChain);
    854855    int scopeDelta = depth(codeBlock, sc) - handler->scopeDepth;
    855856    ASSERT(scopeDelta >= 0);
    856857    while (scopeDelta--)
    857         sc.pop();
    858     callFrame->setScopeChain(sc.node());
     858        scopeChain = scopeChain->pop();
     859    callFrame->setScopeChain(scopeChain);
    859860
    860861    return handler;
Note: See TracChangeset for help on using the changeset viewer.