Skip to content

Commit 7070cca

Browse files
committed
Handle an error if rehashing fails
1 parent 81ae871 commit 7070cca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Python/hamt.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,14 @@ hamt_node_bitmap_assoc(PyHamtNode_Bitmap *self,
883883
Py_INCREF(new_node->a_array[i]);
884884
}
885885
else {
886+
int32_t rehash = hamt_hash(self->b_array[j]);
887+
if (rehash == -1) {
888+
goto fin;
889+
}
890+
886891
new_node->a_array[i] = hamt_node_assoc(
887892
empty, shift + 5,
888-
hamt_hash(self->b_array[j]),
893+
rehash,
889894
self->b_array[j],
890895
self->b_array[j + 1],
891896
added_leaf);

0 commit comments

Comments
 (0)