- fix http://bugs.webkit.org/show_bug.cgi?id=17511
REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
* 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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30550
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-02-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=17511
+ REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
+
+ * 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.
+
2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Rubber stamped by Darin.
if (m_start) {
if (m_end + 1 != m_start)
return;
- } else {
- if (m_end && m_end != m_buffer.capacity() - 1)
+ } else if (m_end) {
+ if (m_end != m_buffer.capacity() - 1)
return;
- }
+ } else if (m_buffer.capacity())
+ return;
+
expandCapacity();
}
template<typename T> template<typename U>
inline void Deque<T>::prepend(const U& value)
{
+ checkValidity();
expandCapacityIfNeeded();
if (!m_start)
m_start = m_buffer.capacity() - 1;
else
--m_start;
new (&m_buffer.buffer()[m_start]) T(value);
+ checkValidity();
}
template<typename T>