Closed Bug 760337 Opened 14 years ago Closed 14 years ago

Add JS_ASSERT(initialized()) where appropriate in HashTable.h

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

Attachments

(1 file)

Bug 710922 was caused by calling all() on a hash table that hadn't had init() called on it. A |JS_ASSERT(initialized())| assertion inside all() would have caught it immediately. There are probably other places where that assertion would also be helpful.
Attached patch patch — — Splinter Review
This patch adds JS_ASSERT(table) to two sets of HashTable methods. - The first set definitely need it: findFreeEntry(), add(), two versions of remove(), all(). - The second set don't need it, but it seems like a good idea just to encourage people to init() their HashTables immediately: empty(), count(), capacity(), generation, sizeOf{In,Ex}cludingThis().
Attachment #629675 - Flags: review?(luke)
Comment on attachment 629675 [details] [diff] [review] patch Looks good
Attachment #629675 - Flags: review?(luke) → review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: