⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 197686 in webkit


Ignore:
Timestamp:
Mar 7, 2016, 10:24:26 AM (11 years ago)
Author:
akling@apple.com
Message:

REGRESSION (r197303): Web Inspector crashes web process when inspecting an element on TOT
<https://webkit.org/b/154812>

Reviewed by Geoffrey Garen.

Guard against null pointer dereference for UnlinkedCodeBlocks that don't have any control flow
profiling data.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::hasOpProfileControlFlowBytecodeOffsets):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r197685 r197686  
     12016-03-07  Andreas Kling  <akling@apple.com>
     2
     3        REGRESSION (r197303): Web Inspector crashes web process when inspecting an element on TOT
     4        <https://webkit.org/b/154812>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Guard against null pointer dereference for UnlinkedCodeBlocks that don't have any control flow
     9        profiling data.
     10
     11        * bytecode/CodeBlock.cpp:
     12        (JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
     13        * bytecode/UnlinkedCodeBlock.h:
     14        (JSC::UnlinkedCodeBlock::hasOpProfileControlFlowBytecodeOffsets):
     15
    1162016-03-07  Benjamin Poulain  <benjamin@webkit.org>
    217
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r197563 r197686  
    42114211void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler(RefCountedArray<Instruction>& instructions)
    42124212{
     4213    if (!unlinkedCodeBlock()->hasOpProfileControlFlowBytecodeOffsets())
     4214        return;
    42134215    const Vector<size_t>& bytecodeOffsets = unlinkedCodeBlock()->opProfileControlFlowBytecodeOffsets();
    42144216    for (size_t i = 0, offsetsLength = bytecodeOffsets.size(); i < offsetsLength; i++) {
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

    r197379 r197686  
    355355        ASSERT(m_rareData);
    356356        return m_rareData->m_opProfileControlFlowBytecodeOffsets;
     357    }
     358    bool hasOpProfileControlFlowBytecodeOffsets() const
     359    {
     360        return m_rareData && !m_rareData->m_opProfileControlFlowBytecodeOffsets.isEmpty();
    357361    }
    358362
Note: See TracChangeset for help on using the changeset viewer.