[ENOMEM] popragate packed/packed_map errors to the serializer.
Will disable further modifications based on a bad state.
This commit is contained in:
parent
7f358a55f4
commit
040ed094ef
|
@ -259,6 +259,7 @@ struct hb_serialize_context_t
|
||||||
if (unlikely (packed.in_error ())) {
|
if (unlikely (packed.in_error ())) {
|
||||||
// obj wasn't successfully added to packed, so clean it up otherwise it's
|
// obj wasn't successfully added to packed, so clean it up otherwise it's
|
||||||
// links will be leaked.
|
// links will be leaked.
|
||||||
|
propagate_error (packed);
|
||||||
obj->fini ();
|
obj->fini ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -266,6 +267,7 @@ struct hb_serialize_context_t
|
||||||
objidx = packed.length - 1;
|
objidx = packed.length - 1;
|
||||||
|
|
||||||
if (share) packed_map.set (obj, objidx);
|
if (share) packed_map.set (obj, objidx);
|
||||||
|
propagate_error (packed_map);
|
||||||
|
|
||||||
return objidx;
|
return objidx;
|
||||||
}
|
}
|
||||||
|
@ -277,6 +279,7 @@ struct hb_serialize_context_t
|
||||||
current->links.shrink (snap.num_links);
|
current->links.shrink (snap.num_links);
|
||||||
revert (snap.head, snap.tail);
|
revert (snap.head, snap.tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
void revert (char *snap_head,
|
void revert (char *snap_head,
|
||||||
char *snap_tail)
|
char *snap_tail)
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue