Skip to content
Snippets Groups Projects
Commit 5e1b2250 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Add missing error check in TrieMap.

Bug: 18725954
Change-Id: I8fcb0d15dda3f823a4575fe707bcdec57ff5e89b
parent ad546afb
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,9 @@ int TrieMap::getNextLevelBitmapEntryIndex(const int key, const int bitmapEntryIn
}
// Create a value entry and a bitmap entry.
const int valueEntryIndex = allocateTable(TERMINAL_LINKED_ENTRY_COUNT);
if (valueEntryIndex == INVALID_INDEX) {
return INVALID_INDEX;
}
if (!writeEntry(Entry(0, terminalEntry.getValue()), valueEntryIndex)) {
return INVALID_INDEX;
}
......@@ -195,6 +198,9 @@ bool TrieMap::writeValue(const uint64_t value, const int terminalEntryIndex) {
}
// Create value entry and write value.
const int valueEntryIndex = allocateTable(TERMINAL_LINKED_ENTRY_COUNT);
if (valueEntryIndex == INVALID_INDEX) {
return false;
}
if (!writeEntry(Entry(value >> (FIELD1_SIZE * CHAR_BIT), value), valueEntryIndex)) {
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment