mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
fixes left_id and suffix_id
This commit is contained in:
parent
0b8e863282
commit
fc272868b8
@ -505,7 +505,7 @@ bool operator<(const RoseEdgeProps &a, const RoseEdgeProps &b) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
bool roseHasTops(const RoseBuildImpl &build, RoseVertex v) {
|
bool roseHasTops(const RoseBuildImpl &build, RoseVertex v) {
|
||||||
const RoseGraph &g = build.g;
|
const RoseGraph &g = build.g;
|
||||||
assert(g[v].left);
|
assert(left_id(g[v].left));
|
||||||
|
|
||||||
set<u32> graph_tops;
|
set<u32> graph_tops;
|
||||||
if (!build.isRootSuccessor(v)) {
|
if (!build.isRootSuccessor(v)) {
|
||||||
|
@ -1918,7 +1918,7 @@ void makeRoleSuffix(const RoseBuildImpl &build,
|
|||||||
if (!g[v].suffix) {
|
if (!g[v].suffix) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(contains(suffixes, g[v].suffix));
|
assert(contains(suffixes, suffix_id(g[v].suffix)));
|
||||||
u32 queue = suffixes.at(suffix_id(g[v].suffix));
|
u32 queue = suffixes.at(suffix_id(g[v].suffix));
|
||||||
u32 event;
|
u32 event;
|
||||||
assert(contains(engine_info_by_queue, queue));
|
assert(contains(engine_info_by_queue, queue));
|
||||||
@ -1991,7 +1991,7 @@ void makeRoleInfixTriggers(const RoseBuildImpl &build,
|
|||||||
make_pair(g[v].index, g[e].rose_top));
|
make_pair(g[v].index, g[e].rose_top));
|
||||||
assert(top < MQE_INVALID);
|
assert(top < MQE_INVALID);
|
||||||
} else if (!isMultiTopType(eng_info.type)) {
|
} else if (!isMultiTopType(eng_info.type)) {
|
||||||
assert(num_tops(g[v].left) == 1);
|
assert(num_tops(left_id(g[v].left)) == 1);
|
||||||
top = MQE_TOP;
|
top = MQE_TOP;
|
||||||
} else {
|
} else {
|
||||||
top = MQE_TOP_FIRST + g[e].rose_top;
|
top = MQE_TOP_FIRST + g[e].rose_top;
|
||||||
|
@ -1290,7 +1290,7 @@ bool attemptRoseGraphMerge(RoseBuildImpl &build, bool preds_same, RoseVertex a,
|
|||||||
ReportID new_report = build.getNewNfaReport();
|
ReportID new_report = build.getNewNfaReport();
|
||||||
duplicateReport(*b_h, b_left.leftfix_report, new_report);
|
duplicateReport(*b_h, b_left.leftfix_report, new_report);
|
||||||
b_left.leftfix_report = new_report;
|
b_left.leftfix_report = new_report;
|
||||||
pruneReportIfUnused(build, b_h, rai.rev_leftfix[b_left_id], b_oldreport);
|
pruneReportIfUnused(build, b_h, rai.rev_leftfix[left_id(b_left_id)], b_oldreport);
|
||||||
|
|
||||||
NGHolder victim;
|
NGHolder victim;
|
||||||
cloneHolder(victim, *a_h);
|
cloneHolder(victim, *a_h);
|
||||||
@ -1326,16 +1326,16 @@ bool attemptRoseGraphMerge(RoseBuildImpl &build, bool preds_same, RoseVertex a,
|
|||||||
a_left.graph = b_h;
|
a_left.graph = b_h;
|
||||||
a_left.leftfix_report = new_report;
|
a_left.leftfix_report = new_report;
|
||||||
|
|
||||||
assert(contains(rai.rev_leftfix[a_left_id], a));
|
assert(contains(rai.rev_leftfix[left_id(a_left_id)], a));
|
||||||
assert(contains(rai.rev_leftfix[b_left_id], b));
|
assert(contains(rai.rev_leftfix[left_id(b_left_id)], b));
|
||||||
rai.rev_leftfix[a_left_id].erase(a);
|
rai.rev_leftfix[left_id(a_left_id)].erase(a);
|
||||||
rai.rev_leftfix[b_left_id].insert(a);
|
rai.rev_leftfix[left_id(b_left_id)].insert(a);
|
||||||
|
|
||||||
pruneUnusedTops(*a_h, g, rai.rev_leftfix[a_left_id]);
|
pruneUnusedTops(*a_h, g, rai.rev_leftfix[left_id(a_left_id)]);
|
||||||
pruneUnusedTops(*b_h, g, rai.rev_leftfix[b_left_id]);
|
pruneUnusedTops(*b_h, g, rai.rev_leftfix[left_id(b_left_id)]);
|
||||||
|
|
||||||
// Prune A's report from its old prefix if it was only used by A.
|
// Prune A's report from its old prefix if it was only used by A.
|
||||||
pruneReportIfUnused(build, a_h, rai.rev_leftfix[a_left_id], a_oldreport);
|
pruneReportIfUnused(build, a_h, rai.rev_leftfix[left_id(a_left_id)], a_oldreport);
|
||||||
|
|
||||||
reduceImplementableGraph(*b_h, SOM_NONE, nullptr, build.cc);
|
reduceImplementableGraph(*b_h, SOM_NONE, nullptr, build.cc);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user