Changeset 51672 in webkit


Ignore:
Timestamp:
Dec 3, 2009 6:17:46 PM (14 years ago)
Author:
oliver@apple.com
Message:

REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?)
https://bugs.webkit.org/show_bug.cgi?id=32133

Reviewed by Gavin Barraclough.

Work around odd GCC-ism and correct the scopechain for use by
calls made while a cachedcall is active on the callstack.

Location:
trunk/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r51671 r51672  
     12009-12-03  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?)
     6        https://bugs.webkit.org/show_bug.cgi?id=32133
     7
     8        Work around odd GCC-ism and correct the scopechain for use by
     9        calls made while a cachedcall is active on the callstack.
     10
     11        * interpreter/CachedCall.h:
     12        (JSC::CachedCall::newCallFrame):
     13        * runtime/JSArray.cpp:
     14        (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
     15        * runtime/StringPrototype.cpp:
     16        (JSC::stringProtoFuncReplace):
     17
    1182009-12-03  Gavin Barraclough  <barraclough@apple.com>
    219
  • trunk/JavaScriptCore/interpreter/CachedCall.h

    r50608 r51672  
    5353        void setThis(JSValue v) { m_closure.setArgument(0, v); }
    5454        void setArgument(int n, JSValue v) { m_closure.setArgument(n + 1, v); }
    55         CallFrame* newCallFrame() { return m_closure.newCallFrame; }
     55
     56        CallFrame* newCallFrame(ExecState* exec)
     57        {
     58            CallFrame* callFrame = m_closure.newCallFrame;
     59            callFrame->setScopeChain(exec->scopeChain());
     60            return callFrame;
     61        }
     62
    5663        ~CachedCall()
    5764        {
  • trunk/JavaScriptCore/interpreter/CallFrame.h

    r48774 r51672  
    4040        JSFunction* callee() const { return this[RegisterFile::Callee].function(); }
    4141        CodeBlock* codeBlock() const { return this[RegisterFile::CodeBlock].Register::codeBlock(); }
    42         ScopeChainNode* scopeChain() const { return this[RegisterFile::ScopeChain].Register::scopeChain(); }
     42        ScopeChainNode* scopeChain() const
     43        {
     44            ASSERT(this[RegisterFile::ScopeChain].Register::scopeChain());
     45            return this[RegisterFile::ScopeChain].Register::scopeChain();
     46        }
    4347        int argumentCount() const { return this[RegisterFile::ArgumentCount].i(); }
    4448
     
    6771        JSGlobalData& globalData() const
    6872        {
     73            ASSERT(scopeChain()->globalData);
    6974            return *scopeChain()->globalData;
    7075        }
  • trunk/JavaScriptCore/runtime/ArrayPrototype.cpp

    r48948 r51672  
    746746            cachedCall.setArgument(1, jsNumber(exec, k));
    747747            cachedCall.setArgument(2, thisObj);
    748            
    749             if (!cachedCall.call().toBoolean(exec))
     748            JSValue result = cachedCall.call();
     749            if (!result.toBoolean(cachedCall.newCallFrame(exec)))
    750750                return jsBoolean(false);
    751751        }
     
    847847            cachedCall.setArgument(1, jsNumber(exec, k));
    848848            cachedCall.setArgument(2, thisObj);
    849            
    850             if (cachedCall.call().toBoolean(exec))
     849            JSValue result = cachedCall.call();
     850            if (result.toBoolean(cachedCall.newCallFrame(exec)))
    851851                return jsBoolean(true);
    852852        }
  • trunk/JavaScriptCore/runtime/JSArray.cpp

    r49065 r51672  
    786786            m_cachedCall->setArgument(0, va);
    787787            m_cachedCall->setArgument(1, vb);
    788             compareResult = m_cachedCall->call().toNumber(m_cachedCall->newCallFrame());
     788            compareResult = m_cachedCall->call().toNumber(m_cachedCall->newCallFrame(m_exec));
    789789        } else {
    790790            MarkedArgumentBuffer arguments;
  • trunk/JavaScriptCore/runtime/StringPrototype.cpp

    r51307 r51672  
    282282               
    283283                cachedCall.setThis(exec->globalThisValue());
    284                 replacements.append(cachedCall.call().toString(cachedCall.newCallFrame()));
     284                JSValue result = cachedCall.call();
     285                replacements.append(result.toString(cachedCall.newCallFrame(exec)));
    285286                if (exec->hadException())
    286287                    break;
Note: See TracChangeset for help on using the changeset viewer.