diff --git a/src/fdr/fdr_confirm_compile.cpp b/src/fdr/fdr_confirm_compile.cpp index e77c46d1..4aa2df0d 100644 --- a/src/fdr/fdr_confirm_compile.cpp +++ b/src/fdr/fdr_confirm_compile.cpp @@ -322,32 +322,15 @@ getFDRConfirm(const vector &lits, bool applyOneCharOpt, LiteralIndex litIdx = *i; // Write LitInfo header. - u8 *oldPtr = ptr; LitInfo &finalLI = *(LitInfo *)ptr; finalLI = tmpLitInfo[litIdx]; ptr += sizeof(LitInfo); // String starts directly after LitInfo. - - // Write literal prefix (everything before the last N characters, - // as the last N are already confirmed). - const string &t = lits[litIdx].s; - if (t.size() > sizeof(CONF_TYPE)) { - size_t prefix_len = t.size() - sizeof(CONF_TYPE); - memcpy(ptr, t.c_str(), prefix_len); - ptr += prefix_len; - } - - ptr = ROUNDUP_PTR(ptr, alignof(LitInfo)); + assert(lits[litIdx].s.size() <= sizeof(CONF_TYPE)); if (next(i) == e) { finalLI.next = 0; } else { - // our next field represents an adjustment on top of - // current address + the actual size of the literal - // so we track any rounding up done for alignment and - // add this in - that way we don't have to use bigger - // than a u8 (for now) - assert((size_t)(ptr - oldPtr) > t.size()); - finalLI.next = verify_u8(ptr - oldPtr - t.size()); + finalLI.next = 1; } } assert((size_t)(ptr - fdrc_base) <= size); diff --git a/src/fdr/fdr_confirm_runtime.h b/src/fdr/fdr_confirm_runtime.h index aaaecb38..55985846 100644 --- a/src/fdr/fdr_confirm_runtime.h +++ b/src/fdr/fdr_confirm_runtime.h @@ -101,7 +101,7 @@ void confWithBit(const struct FDRConfirm *fdrc, const struct FDR_Runtime_Args *a *control = a->cb(loc - buf, i, li->id, a->ctxt); out: oldNext = li->next; // oldNext is either 0 or an 'adjust' value - li = (const struct LitInfo *)((const u8 *)li + oldNext + li->size); + li++; } while (oldNext); }