mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
UE-2919: add termination checks around handleReportInternally
This commit is contained in:
parent
9c9eb2ca9a
commit
4a482b07ea
@ -488,7 +488,8 @@ int roseNfaBlastAdaptor(u64a offset, ReportID id, void *context) {
|
|||||||
offset, id);
|
offset, id);
|
||||||
|
|
||||||
if (handleReportInternally(t, scratch, id, offset)) {
|
if (handleReportInternally(t, scratch, id, offset)) {
|
||||||
return MO_CONTINUE_MATCHING;
|
return can_stop_matching(scratch) ? MO_HALT_MATCHING
|
||||||
|
: MO_CONTINUE_MATCHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLastMatchOffset(tctxt, offset);
|
updateLastMatchOffset(tctxt, offset);
|
||||||
@ -626,7 +627,8 @@ int roseNfaAdaptor(u64a offset, ReportID id, void *context) {
|
|||||||
|
|
||||||
const struct RoseEngine *t = scratch->core_info.rose;
|
const struct RoseEngine *t = scratch->core_info.rose;
|
||||||
if (handleReportInternally(t, scratch, id, offset)) {
|
if (handleReportInternally(t, scratch, id, offset)) {
|
||||||
return MO_CONTINUE_MATCHING;
|
return can_stop_matching(scratch) ? MO_HALT_MATCHING
|
||||||
|
: MO_CONTINUE_MATCHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tctxt->cb(offset, id, scratch);
|
return tctxt->cb(offset, id, scratch);
|
||||||
@ -905,6 +907,7 @@ hwlmcb_rv_t buildSufPQ(const struct RoseEngine *t, char *state, s64a safe_loc,
|
|||||||
|
|
||||||
hwlmcb_rv_t rv = roseCatchUpMPV(t, report_ok_loc, scratch);
|
hwlmcb_rv_t rv = roseCatchUpMPV(t, report_ok_loc, scratch);
|
||||||
if (rv != HWLM_CONTINUE_MATCHING) {
|
if (rv != HWLM_CONTINUE_MATCHING) {
|
||||||
|
DEBUG_PRINTF("terminating...\n");
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1060,6 +1063,7 @@ hwlmcb_rv_t roseCatchUpAll(s64a loc, struct hs_scratch *scratch) {
|
|||||||
rv = roseCatchUpMPV(t, loc, scratch);
|
rv = roseCatchUpMPV(t, loc, scratch);
|
||||||
assert(rv != HWLM_CONTINUE_MATCHING
|
assert(rv != HWLM_CONTINUE_MATCHING
|
||||||
|| scratch->catchup_pq.qm_size <= t->outfixEndQueue);
|
|| scratch->catchup_pq.qm_size <= t->outfixEndQueue);
|
||||||
|
assert(!can_stop_matching(scratch) || rv == HWLM_TERMINATE_MATCHING);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,7 @@ hwlmcb_rv_t roseCatchUpMPV(const struct RoseEngine *t, s64a loc,
|
|||||||
struct hs_scratch *scratch) {
|
struct hs_scratch *scratch) {
|
||||||
u64a cur_offset = loc + scratch->core_info.buf_offset;
|
u64a cur_offset = loc + scratch->core_info.buf_offset;
|
||||||
assert(cur_offset >= scratch->tctxt.minMatchOffset);
|
assert(cur_offset >= scratch->tctxt.minMatchOffset);
|
||||||
|
assert(!can_stop_matching(scratch));
|
||||||
|
|
||||||
if (canSkipCatchUpMPV(t, scratch, cur_offset)) {
|
if (canSkipCatchUpMPV(t, scratch, cur_offset)) {
|
||||||
updateMinMatchOffsetFromMpv(&scratch->tctxt, cur_offset);
|
updateMinMatchOffsetFromMpv(&scratch->tctxt, cur_offset);
|
||||||
@ -151,6 +152,7 @@ hwlmcb_rv_t roseCatchUpTo(const struct RoseEngine *t,
|
|||||||
|| scratch->tctxt.minMatchOffset == end);
|
|| scratch->tctxt.minMatchOffset == end);
|
||||||
assert(rv != HWLM_CONTINUE_MATCHING
|
assert(rv != HWLM_CONTINUE_MATCHING
|
||||||
|| scratch->tctxt.minNonMpvMatchOffset == end);
|
|| scratch->tctxt.minNonMpvMatchOffset == end);
|
||||||
|
assert(!can_stop_matching(scratch) || rv == HWLM_TERMINATE_MATCHING);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +184,7 @@ hwlmcb_rv_t roseHandleChainMatch(const struct RoseEngine *t,
|
|||||||
* be known to be consistent */
|
* be known to be consistent */
|
||||||
if (ensureMpvQueueFlushed(t, scratch, qi, loc, in_catchup)
|
if (ensureMpvQueueFlushed(t, scratch, qi, loc, in_catchup)
|
||||||
== HWLM_TERMINATE_MATCHING) {
|
== HWLM_TERMINATE_MATCHING) {
|
||||||
|
DEBUG_PRINTF("terminating...\n");
|
||||||
return HWLM_TERMINATE_MATCHING;
|
return HWLM_TERMINATE_MATCHING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user