Changeset 27710 in webkit for trunk/JavaScriptCore/ChangeLog


Ignore:
Timestamp:
Nov 11, 2007, 10:44:26 PM (18 years ago)
Author:
Adam Roben
Message:

Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter

The bug was due to a mismatch between HashMap::remove and
HashTable::checkTableConsistency. HashMap::remove can delete the value
stored in the HashTable (by derefing it), which is not normally
allowed by HashTable. It's OK in this case because the value is about
to be removed from the table, but HashTable wasn't aware of this.

HashMap::remove now performs the consistency check itself before
derefing the value.

Darin noticed that the same bug would occur in HashSet, so I've fixed
it there as well.

Reviewed by Darin.

  • wtf/HashMap.h: (WTF::HashMap::remove): Perform the HashTable consistency check manually before calling deref.
  • wtf/HashSet.h: (WTF::HashSet::remove): Ditto.
  • wtf/HashTable.h: Made checkTableConsistency public so that HashMap and HashSet can call it. (WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck): Added. (WTF::HashTable::removeAndInvalidate): Added. (WTF::HashTable::remove): (WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r27709 r27710  
     12007-11-11  Adam Roben  <[email protected]>
     2
     3        Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter
     4
     5        The bug was due to a mismatch between HashMap::remove and
     6        HashTable::checkTableConsistency. HashMap::remove can delete the value
     7        stored in the HashTable (by derefing it), which is not normally
     8        allowed by HashTable. It's OK in this case because the value is about
     9        to be removed from the table, but HashTable wasn't aware of this.
     10
     11        HashMap::remove now performs the consistency check itself before
     12        derefing the value.
     13
     14        Darin noticed that the same bug would occur in HashSet, so I've fixed
     15        it there as well.
     16
     17        Reviewed by Darin.
     18
     19        * wtf/HashMap.h:
     20        (WTF::HashMap::remove): Perform the HashTable consistency check
     21        manually before calling deref.
     22        * wtf/HashSet.h:
     23        (WTF::HashSet::remove): Ditto.
     24        * wtf/HashTable.h: Made checkTableConsistency public so that HashMap
     25        and HashSet can call it.
     26        (WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck):
     27        Added.
     28        (WTF::HashTable::removeAndInvalidate): Added.
     29        (WTF::HashTable::remove):
     30        (WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
     31
    1322007-11-11  Mark Rowe  <[email protected]>
    233
Note: See TracChangeset for help on using the changeset viewer.