diff --git a/src/rose/block.c b/src/rose/block.c index 853f1ead..749bf4e2 100644 --- a/src/rose/block.c +++ b/src/rose/block.c @@ -61,11 +61,11 @@ void runAnchoredTableBlock(const struct RoseEngine *t, const void *atable, if (nfa->type == MCCLELLAN_NFA_8) { nfaExecMcClellan8_B(nfa, curr->anchoredMinDistance, local_buffer, local_alen, - roseAnchoredCallback, &scratch->tctxt); + roseAnchoredCallback, scratch); } else { nfaExecMcClellan16_B(nfa, curr->anchoredMinDistance, local_buffer, local_alen, - roseAnchoredCallback, &scratch->tctxt); + roseAnchoredCallback, scratch); } } @@ -193,7 +193,7 @@ void roseBlockExec_i(const struct RoseEngine *t, struct hs_scratch *scratch, DEBUG_PRINTF("BEGIN SMALL BLOCK (over %zu/%zu)\n", sblen, length); DEBUG_PRINTF("-- %016llx\n", tctxt->groups); hwlmExec(sbtable, scratch->core_info.buf, sblen, 0, roseCallback, - tctxt, tctxt->groups); + scratch, tctxt->groups); goto exit; } @@ -249,7 +249,7 @@ void roseBlockExec_i(const struct RoseEngine *t, struct hs_scratch *scratch, DEBUG_PRINTF("BEGIN FLOATING (over %zu/%zu)\n", flen, length); DEBUG_PRINTF("-- %016llx\n", tctxt->groups); hwlmExec(ftable, buffer, flen, t->floatingMinDistance, - roseCallback, tctxt, tctxt->groups); + roseCallback, scratch, tctxt->groups); } exit:; diff --git a/src/rose/eod.c b/src/rose/eod.c index 24e9113d..449f26f4 100644 --- a/src/rose/eod.c +++ b/src/rose/eod.c @@ -93,7 +93,8 @@ hwlmcb_rv_t roseEodRunMatcher(const struct RoseEngine *t, u64a offset, struct RoseContext *tctxt = &scratch->tctxt; const struct HWLM *etable = getELiteralMatcher(t); - hwlmExec(etable, eod_data, eod_len, adj, roseCallback, tctxt, tctxt->groups); + hwlmExec(etable, eod_data, eod_len, adj, roseCallback, scratch, + tctxt->groups); // We may need to fire delayed matches return cleanUpDelayed(t, scratch, 0, offset); diff --git a/src/rose/match.c b/src/rose/match.c index 57a1688c..b2b0238d 100644 --- a/src/rose/match.c +++ b/src/rose/match.c @@ -223,8 +223,8 @@ event_enqueued: } int roseAnchoredCallback(u64a end, u32 id, void *ctx) { - struct RoseContext *tctxt = ctx; - struct hs_scratch *scratch = tctxtToScratch(tctxt); + struct hs_scratch *scratch = ctx; + struct RoseContext *tctxt = &scratch->tctxt; struct core_info *ci = &scratch->core_info; const struct RoseEngine *t = ci->rose; @@ -507,8 +507,8 @@ anchored_leftovers:; } hwlmcb_rv_t roseCallback(size_t start, size_t end, u32 id, void *ctxt) { - struct RoseContext *tctx = ctxt; - struct hs_scratch *scratch = tctxtToScratch(tctx); + struct hs_scratch *scratch = ctxt; + struct RoseContext *tctx = &scratch->tctxt; const struct RoseEngine *t = scratch->core_info.rose; u64a real_end = end + tctx->lit_offset_adjust; diff --git a/src/rose/stream.c b/src/rose/stream.c index 759f7553..31a0227f 100644 --- a/src/rose/stream.c +++ b/src/rose/stream.c @@ -83,11 +83,11 @@ void runAnchoredTableStream(const struct RoseEngine *t, const void *atable, if (nfa->type == MCCLELLAN_NFA_8) { nfaExecMcClellan8_SimpStream(nfa, state, scratch->core_info.buf, start, adj, alen, roseAnchoredCallback, - &scratch->tctxt); + scratch); } else { nfaExecMcClellan16_SimpStream(nfa, state, scratch->core_info.buf, - start, adj, alen, roseAnchoredCallback, - &scratch->tctxt); + start, adj, alen, + roseAnchoredCallback, scratch); } next_nfa: @@ -542,7 +542,7 @@ void roseStreamExec(const struct RoseEngine *t, struct hs_scratch *scratch, } DEBUG_PRINTF("BEGIN FLOATING (over %zu/%zu)\n", flen, length); - hwlmExecStreaming(ftable, scratch, flen, start, roseCallback, tctxt, + hwlmExecStreaming(ftable, scratch, flen, start, roseCallback, scratch, tctxt->groups, stream_state); }