mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-01 03:57:43 +03:00
ng: ensure that only match states have reports
Ensure (and assert) that vertices without an edge to {accept, acceptEod} do not have reports set.
This commit is contained in:
committed by
Matthew Barr
parent
3d9a60d023
commit
4ce268af47
@@ -31,14 +31,15 @@
|
||||
|
||||
#include "grey.h"
|
||||
#include "compiler/compiler.h"
|
||||
#include "nfagraph/ng.h"
|
||||
#include "nfagraph/ng_limex.h"
|
||||
#include "nfagraph/ng_restructuring.h"
|
||||
#include "nfa/limex_context.h"
|
||||
#include "nfa/limex_internal.h"
|
||||
#include "nfa/nfa_api.h"
|
||||
#include "nfa/nfa_api_util.h"
|
||||
#include "nfa/nfa_internal.h"
|
||||
#include "nfagraph/ng.h"
|
||||
#include "nfagraph/ng_limex.h"
|
||||
#include "nfagraph/ng_restructuring.h"
|
||||
#include "nfagraph/ng_util.h"
|
||||
#include "util/alloc.h"
|
||||
#include "util/target_info.h"
|
||||
|
||||
@@ -76,6 +77,7 @@ protected:
|
||||
ParsedExpression parsed(0, expr.c_str(), flags, 0);
|
||||
unique_ptr<NGWrapper> g = buildWrapper(rm, cc, parsed);
|
||||
ASSERT_TRUE(g != nullptr);
|
||||
clearReports(*g);
|
||||
|
||||
rm.setProgramOffset(0, MATCH_REPORT);
|
||||
|
||||
@@ -310,10 +312,12 @@ protected:
|
||||
ParsedExpression parsed(0, expr.c_str(), flags, 0);
|
||||
unique_ptr<NGWrapper> g = buildWrapper(rm, cc, parsed);
|
||||
ASSERT_TRUE(g != nullptr);
|
||||
clearReports(*g);
|
||||
|
||||
// Reverse the graph and add some reports on the accept vertices.
|
||||
NGHolder g_rev(NFA_REV_PREFIX);
|
||||
reverseHolder(*g, g_rev);
|
||||
clearReports(g_rev);
|
||||
for (NFAVertex v : inv_adjacent_vertices_range(g_rev.accept, g_rev)) {
|
||||
g_rev[v].reports.insert(0);
|
||||
}
|
||||
@@ -367,6 +371,7 @@ protected:
|
||||
ReportManager rm(cc.grey);
|
||||
unique_ptr<NGWrapper> g = buildWrapper(rm, cc, parsed);
|
||||
ASSERT_TRUE(g != nullptr);
|
||||
clearReports(*g);
|
||||
|
||||
rm.setProgramOffset(0, MATCH_REPORT);
|
||||
|
||||
|
Reference in New Issue
Block a user