mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
RuleMatcher: Use a single list for tracking pattern_matches
This commit is contained in:
parent
0ecbd4435e
commit
e443624c32
3 changed files with 53 additions and 25 deletions
|
@ -104,9 +104,8 @@ void RuleActionEvent::DoAction(const Rule* parent, RuleEndpointState* state, con
|
|||
args.push_back(zeek::val_mgr->EmptyString());
|
||||
|
||||
if ( want_end_of_match ) {
|
||||
// PList::member_pos() doesn't like const Rule*, need const_cast.
|
||||
int rule_offset = state->matched_by_patterns.member_pos(const_cast<Rule*>(parent));
|
||||
MatchPos end_of_match = (rule_offset >= 0 && data) ? state->matched_text_end_of_match[rule_offset] : 0;
|
||||
auto* match = state->FindRulePatternMatch(parent);
|
||||
MatchPos end_of_match = (match != nullptr && data) ? match->end_of_match : 0;
|
||||
args.push_back(zeek::val_mgr->Count(end_of_match));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue