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:
Nicholas Nethercote
2015-02-02 14:48:58 -08:00
parent 073c69e299
commit a3bf151ee6
39 changed files with 146 additions and 116 deletions

View File

@@ -230,7 +230,8 @@ nsCommandParams::GetOrMakeEntry(const char* aName, uint8_t entryType)
return foundEntry;
}
foundEntry = (HashEntry *)PL_DHashTableAdd(&mValuesHash, (void *)aName);
foundEntry = static_cast<HashEntry*>
(PL_DHashTableAdd(&mValuesHash, (void *)aName, fallible));
if (!foundEntry) {
return nullptr;
}