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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user