Bug 1050035 (part 4) - Make PL_DHashTableAdd() infallible by default, and add a fallible alternative. r=froydnj.
I kept all the existing PL_DHashTableAdd() calls fallible, in order to be conservative, except for the ones in nsAtomTable.cpp which already were followed immediately by an abort on failure.
This commit is contained in:
@@ -94,7 +94,7 @@ nsHTMLEntities::AddRefTable(void)
|
||||
// add to Entity->Unicode table
|
||||
EntityNodeEntry* entry =
|
||||
static_cast<EntityNodeEntry*>
|
||||
(PL_DHashTableAdd(&gEntityToUnicode, node->mStr));
|
||||
(PL_DHashTableAdd(&gEntityToUnicode, node->mStr, fallible));
|
||||
NS_ASSERTION(entry, "Error adding an entry");
|
||||
// Prefer earlier entries when we have duplication.
|
||||
if (!entry->node)
|
||||
@@ -103,7 +103,8 @@ nsHTMLEntities::AddRefTable(void)
|
||||
// add to Unicode->Entity table
|
||||
entry = static_cast<EntityNodeEntry*>
|
||||
(PL_DHashTableAdd(&gUnicodeToEntity,
|
||||
NS_INT32_TO_PTR(node->mUnicode)));
|
||||
NS_INT32_TO_PTR(node->mUnicode),
|
||||
fallible));
|
||||
NS_ASSERTION(entry, "Error adding an entry");
|
||||
// Prefer earlier entries when we have duplication.
|
||||
if (!entry->node)
|
||||
|
||||
Reference in New Issue
Block a user