[subset] Assert offsets are zero during relocation

If they're not, it's a bug in our subsetting logic somewhere.  So check.
This commit is contained in:
Behdad Esfahbod 2019-04-17 17:58:13 -04:00
parent efbba7ad26
commit db0c9a1485
1 changed files with 2 additions and 0 deletions

View File

@ -294,12 +294,14 @@ struct hb_serialize_context_t
if (link.is_wide)
{
auto &off = * ((BEInt<uint32_t, 4> *) (parent.head + link.position));
assert (0 == off);
off = offset;
propagate_error (off == offset);
}
else
{
auto &off = * ((BEInt<uint16_t, 2> *) (parent.head + link.position));
assert (0 == off);
off = offset;
propagate_error (off == offset);
}