fix whence=Head; position as 28 bits
This commit is contained in:
parent
4ca8e0d989
commit
1aed6d223c
|
@ -78,7 +78,7 @@ struct hb_serialize_context_t
|
||||||
bool is_wide: 1;
|
bool is_wide: 1;
|
||||||
bool is_signed: 1;
|
bool is_signed: 1;
|
||||||
whence_t whence: 2;
|
whence_t whence: 2;
|
||||||
unsigned position: 29;
|
unsigned position: 28;
|
||||||
unsigned bias;
|
unsigned bias;
|
||||||
objidx_t objidx;
|
objidx_t objidx;
|
||||||
};
|
};
|
||||||
|
@ -296,10 +296,15 @@ struct hb_serialize_context_t
|
||||||
link.whence = whence;
|
link.whence = whence;
|
||||||
link.position = (const char *) &ofs - current->head;
|
link.position = (const char *) &ofs - current->head;
|
||||||
if (whence == Head)
|
if (whence == Head)
|
||||||
|
{
|
||||||
|
if (base == nullptr)
|
||||||
|
link.bias = 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
assert (current->head <= (const char *)base);
|
assert (current->head <= (const char *)base);
|
||||||
link.bias = (const char *) base - current->head;
|
link.bias = (const char *) base - current->head;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
link.bias = 0;
|
link.bias = 0;
|
||||||
link.objidx = objidx;
|
link.objidx = objidx;
|
||||||
|
|
Loading…
Reference in New Issue