Closed Bug 520891 Opened 15 years ago Closed 15 years ago

Hashtable constructor uses Put incorrectly

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: zpao, Assigned: mrbkap)

Details

Attachments

(1 file, 1 obsolete file)

Put returns null on successful add. c'tor takes that to mean out of memory. Or something like that. Blake knows.
Attached patch Proposed fix (obsolete) — Splinter Review
This fixes the bug, but as the proposed checkin comment says is not entirely correct if the hashtable add does, in fact, run out of memory. Fixing that, however, requires changing the signature of nsHashtable::Put and all of its callers, so I'd rather not do that.

This allows us to serialize principals that have capabilities, which unblocks some tests that zpao was debugging.
Attachment #404951 - Flags: review?
Attachment #404951 - Flags: review? → review?(benjamin)
Attached patch UpdatedSplinter Review
Attachment #404951 - Attachment is obsolete: true
Attachment #405094 - Flags: review?(benjamin)
Attachment #404951 - Flags: review?(benjamin)
Attachment #405094 - Flags: review?(benjamin) → review+
http://hg.mozilla.org/mozilla-central/rev/0eee0c1d69a8
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Is this safe to take on 1.9.2? It would be nice to have those tests enabled.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: