fdr: reduce confirm size to a u8

Also removes the flexible array member from the LitInfo structure.
This commit is contained in:
Justin Viiret
2016-09-13 15:52:39 +10:00
committed by Matthew Barr
parent 98c791dc6e
commit f7cc8a618d
3 changed files with 10 additions and 10 deletions

View File

@@ -107,7 +107,7 @@ void fillLitInfo(const vector<hwlmLiteral> &lits, vector<LitInfo> &tmpLitInfo,
info.extended_size = verify_u8(lit.msk.size());
}
info.flags = flags;
info.size = verify_u32(lit.s.size());
info.size = verify_u8(lit.s.size());
info.groups = lit.groups;
// these are built up assuming a LE machine
@@ -333,8 +333,8 @@ getFDRConfirm(const vector<hwlmLiteral> &lits, bool applyOneCharOpt,
const string &t = lits[litIdx].s;
if (t.size() > sizeof(CONF_TYPE)) {
size_t prefix_len = t.size() - sizeof(CONF_TYPE);
memcpy(&finalLI.s[0], t.c_str(), prefix_len);
ptr = &finalLI.s[0] + prefix_len;
memcpy(ptr, t.c_str(), prefix_len);
ptr += prefix_len;
}
ptr = ROUNDUP_PTR(ptr, alignof(LitInfo));