Changeset 109059 in webkit


Ignore:
Timestamp:
Feb 27, 2012 6:35:29 PM (12 years ago)
Author:
oliver@apple.com
Message:

sputnik/Unicode/Unicode_500/S7.2_A1.6_T1.html crashes in the interpreter
https://bugs.webkit.org/show_bug.cgi?id=79728

Reviewed by Gavin Barraclough.

When initialising a chained get instruction we may end up in a state where
the instruction stream says we have a scopechain, but it has not yet been set
(eg. if allocating the StructureChain itself is what leads to the GC). We could
re-order the allocation, but it occurs in a couple of places, so it seems less
fragile simply to null check the scopechain slot before we actually visit the slot.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::visitStructures):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r109040 r109059  
     12012-02-27  Oliver Hunt  <oliver@apple.com>
     2
     3        sputnik/Unicode/Unicode_500/S7.2_A1.6_T1.html crashes in the interpreter
     4        https://bugs.webkit.org/show_bug.cgi?id=79728
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        When initialising a chained get instruction we may end up in a state where
     9        the instruction stream says we have a scopechain, but it has not yet been set
     10        (eg. if allocating the StructureChain itself is what leads to the GC).  We could
     11        re-order the allocation, but it occurs in a couple of places, so it seems less
     12        fragile simply to null check the scopechain slot before we actually visit the slot.
     13
     14        * bytecode/CodeBlock.cpp:
     15        (JSC::CodeBlock::visitStructures):
     16
    1172012-02-27  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r109007 r109059  
    15821582    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
    15831583        visitor.append(&vPC[4].u.structure);
    1584         visitor.append(&vPC[5].u.structureChain);
     1584        if (vPC[5].u.structureChain)
     1585            visitor.append(&vPC[5].u.structureChain);
    15851586        return;
    15861587    }
     
    15881589        visitor.append(&vPC[4].u.structure);
    15891590        visitor.append(&vPC[5].u.structure);
    1590         visitor.append(&vPC[6].u.structureChain);
     1591        if (vPC[6].u.structureChain)
     1592            visitor.append(&vPC[6].u.structureChain);
    15911593        return;
    15921594    }
Note: See TracChangeset for help on using the changeset viewer.