mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
ng_limex: add edges in deterministic ordering
This commit is contained in:
parent
e108cb841f
commit
21a1b47637
@ -177,7 +177,12 @@ NFAVertex makeTopStartVertex(NGHolder &g, const flat_set<u32> &tops,
|
|||||||
NFAVertex u = add_vertex(g[g.start], g);
|
NFAVertex u = add_vertex(g[g.start], g);
|
||||||
CharReach top_cr = calcTopVertexReach(tops, top_reach);
|
CharReach top_cr = calcTopVertexReach(tops, top_reach);
|
||||||
g[u].char_reach = top_cr;
|
g[u].char_reach = top_cr;
|
||||||
for (auto v : succs) {
|
|
||||||
|
// Add edges in vertex index order, for determinism.
|
||||||
|
vector<NFAVertex> ordered_succs(begin(succs), end(succs));
|
||||||
|
sort(begin(ordered_succs), end(ordered_succs), make_index_ordering(g));
|
||||||
|
|
||||||
|
for (auto v : ordered_succs) {
|
||||||
if (v == g.accept || v == g.acceptEod) {
|
if (v == g.accept || v == g.acceptEod) {
|
||||||
reporter = true;
|
reporter = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user