[serialize] Catch signedness overflows in check_assign()

Should address https://github.com/harfbuzz/harfbuzz/pull/2163#pullrequestreview-355137936
This commit is contained in:
Behdad Esfahbod 2020-02-12 15:41:21 +00:00
parent 97229244eb
commit d663e28af1

View File

@ -123,7 +123,7 @@ struct hb_serialize_context_t
template <typename T1, typename T2>
bool check_equal (T1 &&v1, T2 &&v2)
{ return check_success (v1 == v2); }
{ return check_success ((long long) v1 == (long long) v2); }
template <typename T1, typename T2>
bool check_assign (T1 &v1, T2 &&v2)