Ignore:
Timestamp:
Nov 10, 2007, 5:07:00 PM (18 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

Reviewed by Sam.

Test: fast/js/delete-then-put.html

  • kjs/property_map.cpp: (KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working. (KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this problem before.
  • roll out a last-minute change to my evaluateToBoolean patch that was incorrect.
  • kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to optimizeForUnnecessaryResult, since the result is used in some cases.

LayoutTests:

Reviewed by Sam.

  • fast/js/delete-then-put-expected.txt: Added.
  • fast/js/delete-then-put.html: Added.
  • fast/js/resources/delete-then-put.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/property_map.cpp

    r27637 r27678  
    427427        // slot that we can use. We know it will be there because we did at least one
    428428        // deletion in the past that left an entry empty.
    429         while (m_u.table->entries()[--entryIndex].key)
     429        while (m_u.table->entries()[--entryIndex - 1].key)
    430430            ;
    431431    }
     
    820820            continue;
    821821        }
     822        ASSERT(entryIndex > deletedSentinelIndex);
     823        ASSERT(entryIndex - 1 <= m_u.table->keyCount + m_u.table->deletedSentinelCount);
    822824        ++indexCount;
    823825
    824826        for (unsigned b = a + 1; b != m_u.table->size; ++b)
    825827            ASSERT(m_u.table->entryIndicies[b] != entryIndex);
    826 
    827828    }
    828829    ASSERT(indexCount == m_u.table->keyCount);
     
    831832    ASSERT(m_u.table->entries()[0].key == 0);
    832833
    833     unsigned entryCount = m_u.table->keyCount + m_u.table->deletedSentinelCount;
    834834    unsigned nonEmptyEntryCount = 0;
    835     for (unsigned c = 1; c <= entryCount; ++c) {
     835    for (unsigned c = 1; c <= m_u.table->keyCount + m_u.table->deletedSentinelCount; ++c) {
    836836        UString::Rep* rep = m_u.table->entries()[c].key;
    837837        if (!rep) {
Note: See TracChangeset for help on using the changeset viewer.