mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
role aliasing: bail if new graph is not implementable
This commit is contained in:
parent
1fad822735
commit
5706acf5c0
@ -1125,6 +1125,8 @@ bool attemptRoseGraphMerge(RoseBuildImpl &build, bool preds_same, RoseVertex a,
|
|||||||
shared_ptr<NGHolder> a_h = a_left.graph;
|
shared_ptr<NGHolder> a_h = a_left.graph;
|
||||||
shared_ptr<NGHolder> b_h = b_left.graph;
|
shared_ptr<NGHolder> b_h = b_left.graph;
|
||||||
assert(a_h && b_h);
|
assert(a_h && b_h);
|
||||||
|
assert(isImplementableNFA(*a_h, nullptr, build.cc));
|
||||||
|
assert(isImplementableNFA(*b_h, nullptr, build.cc));
|
||||||
|
|
||||||
// If we only differ in reports, this is a very easy merge. Just use b's
|
// If we only differ in reports, this is a very easy merge. Just use b's
|
||||||
// report for both.
|
// report for both.
|
||||||
@ -1215,6 +1217,11 @@ bool attemptRoseGraphMerge(RoseBuildImpl &build, bool preds_same, RoseVertex a,
|
|||||||
duplicateReport(*new_graph, b_left.leftfix_report, new_report);
|
duplicateReport(*new_graph, b_left.leftfix_report, new_report);
|
||||||
pruneAllOtherReports(*new_graph, new_report);
|
pruneAllOtherReports(*new_graph, new_report);
|
||||||
|
|
||||||
|
if (!isImplementableNFA(*new_graph, nullptr, build.cc)) {
|
||||||
|
DEBUG_PRINTF("new graph not implementable\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
rai.rev_leftfix[a_left_id].erase(a);
|
rai.rev_leftfix[a_left_id].erase(a);
|
||||||
rai.rev_leftfix[b_left_id].erase(b);
|
rai.rev_leftfix[b_left_id].erase(b);
|
||||||
pruneUnusedTops(*a_h, g, rai.rev_leftfix[a_left_id]);
|
pruneUnusedTops(*a_h, g, rai.rev_leftfix[a_left_id]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user