We ignore the data of m_dataArray at the moment, which causes crashes in many tests. Radar: <rdar://problem/10786745> Related to https://bugs.webkit.org/show_bug.cgi?id=77715 Patch coming after I get some sleep :)
Created attachment 125422 [details] Patch
Comment on attachment 125422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125422&action=review Thinking about it...here is a couple more ASSERT() to avoid future problems. Tell me if you can think of useful additional ones. > Source/WebCore/platform/SharedBuffer.cpp:261 > + someData = m_segments[segment] + positionInSegment; ASSERT(segment < m_segments.size()); > Source/WebCore/platform/SharedBuffer.cpp:265 > + position -= maxSegmentedSize; ASSERT(maxSegmentedSize <= position); > Source/WebCore/platform/cf/SharedBufferCF.cpp:125 > + unsigned localOffset = position - totalOffset; ASSERT(totalOffset <= position);
Comment on attachment 125422 [details] Patch Patch looks fine to me. But yeah, we should really fix bug 77715. I'm surprised this was all working so far with this bug.
Comment on attachment 125422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125422&action=review r=me >> Source/WebCore/platform/SharedBuffer.cpp:261 >> + someData = m_segments[segment] + positionInSegment; > > ASSERT(segment < m_segments.size()); This is a redundant ASSERT(). It will always be true inside this if statement because it's already checking (segment < segments) and segments = m_segments.size(). > Source/WebCore/platform/SharedBuffer.cpp:269 > +#endif > + ASSERT_NOT_REACHED(); > + return 0; The last part of this method should be in an #else/#endif clause: #else ASSERT_NOT_REACHED(); return 0; #endif > Source/WebCore/platform/cf/SharedBufferCF.cpp:121 > + Vector<RetainPtr<CFDataRef> >::const_iterator end = m_dataArray.end(); Nit: Might be nice to have a typedef for Vector<RetainPtr<CFDataRef> >.
It is <rdar://problem/10801705> Sorry David.
Committed r107648: <http://trac.webkit.org/changeset/107648>
> > Source/WebCore/platform/cf/SharedBufferCF.cpp:121 > > + Vector<RetainPtr<CFDataRef> >::const_iterator end = m_dataArray.end(); > > Nit: Might be nice to have a typedef for Vector<RetainPtr<CFDataRef> >. This is a good idea for the whole class. I'll fix that separately: https://bugs.webkit.org/show_bug.cgi?id=78552