Error when link width not in [2, 4]

This commit is contained in:
Garret Rieger 2021-05-12 14:46:54 -07:00
parent b23f29bf05
commit 5e0ec33b3d

View File

@ -629,26 +629,31 @@ struct graph_t
char* head, char* head,
hb_serialize_context_t* c) const hb_serialize_context_t* c) const
{ {
if (link.width == 4) switch (link.width)
{ {
case 4:
if (link.is_signed) if (link.is_signed)
{ {
serialize_link_of_type<OT::HBINT32> (link, head, c); serialize_link_of_type<OT::HBINT32> (link, head, c);
} else { } else {
serialize_link_of_type<OT::HBUINT32> (link, head, c); serialize_link_of_type<OT::HBUINT32> (link, head, c);
} }
} return;
else if (link.width == 2) case 2:
{
if (link.is_signed) if (link.is_signed)
{ {
serialize_link_of_type<OT::HBINT16> (link, head, c); serialize_link_of_type<OT::HBINT16> (link, head, c);
} else { } else {
serialize_link_of_type<OT::HBUINT16> (link, head, c); serialize_link_of_type<OT::HBUINT16> (link, head, c);
} }
} return;
else case 3:
serialize_link_of_type<OT::HBUINT24> (link, head, c); serialize_link_of_type<OT::HBUINT24> (link, head, c);
return;
default:
// Unexpected link width.
assert (0);
}
} }
public: public: