h[v].reports.insert(exit_ids.begin(), exit_ids.end());
}
-u32 anchoredStateSize(const anchored_matcher_info *atable) {
- if (!atable) {
- return 0;
- }
-
- const struct anchored_matcher_info *curr = atable;
+u32 anchoredStateSize(const anchored_matcher_info &atable) {
+ const struct anchored_matcher_info *curr = &atable;
// Walk the list until we find the last element; total state size will be
// that engine's state offset plus its state requirement.
return curr->state_offset + nfa->scratchStateSize;
}
-bool anchoredIsMulti(const anchored_matcher_info *atable) {
- return atable && atable->next_offset;
+bool anchoredIsMulti(const anchored_matcher_info &atable) {
+ return atable.next_offset;
}
namespace {
aligned_unique_ptr<anchored_matcher_info>
buildAnchoredAutomataMatcher(RoseBuildImpl &build, size_t *asize);
-u32 anchoredStateSize(const anchored_matcher_info *atable);
+u32 anchoredStateSize(const anchored_matcher_info &atable);
/**
* \brief True if there is an anchored matcher and it consists of multiple
* DFAs.
*/
-bool anchoredIsMulti(const anchored_matcher_info *atable);
+bool anchoredIsMulti(const anchored_matcher_info &atable);
#define ANCHORED_FAIL 0
#define ANCHORED_SUCCESS 1
static
u32 findMinFloatingLiteralMatch(const RoseBuildImpl &build,
const anchored_matcher_info *atable) {
- if (anchoredIsMulti(atable)) {
+ if (atable && anchoredIsMulti(*atable)) {
DEBUG_PRINTF("multiple anchored dfas\n");
/* We must regard matches from other anchored tables as unordered, as
* we do for floating matches. */
// Build engine header and copy tables into place.
- u32 anchorStateSize = anchoredStateSize(atable.get());
+ u32 anchorStateSize = atable ? anchoredStateSize(*atable) : 0;
DEBUG_PRINTF("rose history required %zu\n", historyRequired);
assert(!cc.streaming || historyRequired <= cc.grey.maxHistoryAvailable);
write_out(&engine->state_init, (char *)engine.get(), state_scatter,
state_scatter_aux_offset);
- if (anchoredIsMulti(atable.get())) {
+ if (atable && anchoredIsMulti(*atable)) {
engine->maxSafeAnchoredDROffset = 1;
} else {
/* overly conservative, really need the min offset of non dr anchored