Summary: | MessageQueue::removeIf() has a bug that leads to failed assertions | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dumitru Daniliuc <dumi> | ||||
Component: | New Bugs | Assignee: | Dumitru Daniliuc <dumi> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | dglazkov, kbalazs, michaeln | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Dumitru Daniliuc
2009-11-18 18:43:07 PST
Created attachment 43477 [details]
patch
Comment on attachment 43477 [details]
patch
Cool catch! r=me
Please consider also this shape of the loop, it seems a bit simpler (if you agree, it can be changed on landing):
while (true) {
DequeConstIterator<DataType*> found = m_queue.findIf(predicate);
if (found == m_queue.end())
break;
DataType* message = *found;
m_queue.remove(found);
delete message;
}
(In reply to comment #2) > (From update of attachment 43477 [details]) > Cool catch! r=me > > Please consider also this shape of the loop, it seems a bit simpler (if you > agree, it can be changed on landing): > > while (true) { > DequeConstIterator<DataType*> found = m_queue.findIf(predicate); > if (found == m_queue.end()) > break; > > DataType* message = *found; > m_queue.remove(found); > delete message; > } Changing the loop as you suggested. Wasn't sure if 'while (true)' was acceptable in WebKit code. I have found a similar bug: https://bugs.webkit.org/show_bug.cgi?id=65263 |