Changeset 30550 in webkit


Ignore:
Timestamp:
Feb 24, 2008, 10:44:26 AM (17 years ago)
Author:
mitz@apple.com
Message:

Reviewed by Darin Adler.

  • wtf/Deque.h: (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end are both zero but the buffer capacity is non-zero. (WTF::::prepend): Added validity checks.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r30542 r30550  
     12008-02-24  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=17511
     6          REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
     7
     8        * wtf/Deque.h:
     9        (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
     10        are both zero but the buffer capacity is non-zero.
     11        (WTF::::prepend): Added validity checks.
     12
    1132008-02-23  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
    214
  • trunk/JavaScriptCore/wtf/Deque.h

    r30538 r30550  
    370370            if (m_end + 1 != m_start)
    371371                return;
    372         } else {
    373             if (m_end && m_end != m_buffer.capacity() - 1)
     372        } else if (m_end) {
     373            if (m_end != m_buffer.capacity() - 1)
    374374                return;
    375         }
     375        } else if (m_buffer.capacity())
     376            return;
     377
    376378        expandCapacity();
    377379    }
     
    413415    inline void Deque<T>::prepend(const U& value)
    414416    {
     417        checkValidity();
    415418        expandCapacityIfNeeded();
    416419        if (!m_start)
     
    419422            --m_start;
    420423        new (&m_buffer.buffer()[m_start]) T(value);
     424        checkValidity();
    421425    }
    422426
Note: See TracChangeset for help on using the changeset viewer.