rose: use program offset, not final_id, in atable

This removes the need to look up the program offset in a table when
handling an anchored literal match.
This commit is contained in:
Justin Viiret
2016-07-14 11:40:49 +10:00
committed by Matthew Barr
parent 4dbbc4eaa5
commit 8754cbbd24
4 changed files with 42 additions and 9 deletions

View File

@@ -220,10 +220,9 @@ int roseAnchoredCallback(u64a start, u64a end, u32 id, void *ctx) {
tctxt->lastEndOffset = real_end;
}
const u32 *programs = getByOffset(t, t->litProgramOffset);
assert(id < t->literalCount);
// Note that the "id" we have been handed is the program offset.
const u8 flags = ROSE_PROG_FLAG_IN_ANCHORED;
if (roseRunProgram(t, scratch, programs[id], start, real_end, match_len,
if (roseRunProgram(t, scratch, id, start, real_end, match_len,
flags) == HWLM_TERMINATE_MATCHING) {
assert(can_stop_matching(scratch));
DEBUG_PRINTF("caller requested termination\n");