Ignore:
Timestamp:
Jan 23, 2015, 11:52:25 AM (10 years ago)
Author:
[email protected]
Message:

Immediate crash when setting JS breakpoint
https://bugs.webkit.org/show_bug.cgi?id=140811

Reviewed by Mark Lam.

When the DFG stack layout phase doesn't allocate a register for the scope register,
it incorrectly sets the scope register in the code block to a bad value, one with
an offset of 0. Changed it so that we set the code block's scope register to the
invalid VirtualRegister instead.

No tests needed as adding the ASSERT in setScopeRegister() was used to find the bug.
We crash with that ASSERT in testapi and likely many other tests as well.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::setScopeRegister):
(JSC::CodeBlock::scopeRegister):
Added ASSERTs to catch any future improper setting of the code block's scope register.

  • dfg/DFGStackLayoutPhase.cpp:

(JSC::DFG::StackLayoutPhase::run):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r178693 r179015  
    325325    void setScopeRegister(VirtualRegister scopeRegister)
    326326    {
     327        ASSERT(scopeRegister.isLocal() || !scopeRegister.isValid());
    327328        m_scopeRegister = scopeRegister;
    328329    }
     
    330331    VirtualRegister scopeRegister() const
    331332    {
    332         ASSERT(m_scopeRegister.isValid());
    333333        return m_scopeRegister;
    334334    }
Note: See TracChangeset for help on using the changeset viewer.