[serialize] Handle non-nullable offsets
This commit is contained in:
parent
e04518bafc
commit
e42b82c828
|
@ -281,19 +281,24 @@ struct OffsetTo : Offset<OffsetType, has_null>
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void serialize_subset (hb_subset_context_t *c, const T &src, const void *base)
|
bool serialize_subset (hb_subset_context_t *c, const T &src, const void *base)
|
||||||
{
|
{
|
||||||
*this = 0;
|
*this = 0;
|
||||||
if (&src == &Null (T))
|
if (has_null && &src == &Null (T))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
c->serializer->push ();
|
c->serializer->push ();
|
||||||
if (src.subset (c))
|
|
||||||
|
bool ret = src.subset (c);
|
||||||
|
|
||||||
|
if (ret || !has_null)
|
||||||
c->serializer->add_link (*this,
|
c->serializer->add_link (*this,
|
||||||
c->serializer->pop_pack (),
|
c->serializer->pop_pack (),
|
||||||
base);
|
base);
|
||||||
else
|
else
|
||||||
c->serializer->pop_discard ();
|
c->serializer->pop_discard ();
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const
|
bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const
|
||||||
|
|
Loading…
Reference in New Issue