mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Ensure max width of repeat before transforming graph.
This commit is contained in:
parent
72d21a9acf
commit
aa6025012b
@ -766,9 +766,16 @@ void replaceSubgraphWithSpecial(NGHolder &g, ReachSubgraph &rsi,
|
|||||||
unordered_map<NFAVertex, NFAVertexDepth> &depths,
|
unordered_map<NFAVertex, NFAVertexDepth> &depths,
|
||||||
unordered_set<NFAVertex> &created) {
|
unordered_set<NFAVertex> &created) {
|
||||||
assert(!rsi.bad);
|
assert(!rsi.bad);
|
||||||
|
/* As we may need to unpeel 2 vertices, we need the width to be more than 2.
|
||||||
|
* This should only happen if the graph did not have redundancy pass
|
||||||
|
* performed on as vertex count checks would be prevent us reaching here.
|
||||||
|
*/
|
||||||
|
if (rsi.repeatMax <= depth(2)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
assert(rsi.repeatMin > depth(0));
|
assert(rsi.repeatMin > depth(0));
|
||||||
assert(rsi.repeatMax >= rsi.repeatMin);
|
assert(rsi.repeatMax >= rsi.repeatMin);
|
||||||
assert(rsi.repeatMax > depth(2)); /* may need to unpeel 2 vertices */
|
assert(rsi.repeatMax > depth(2));
|
||||||
|
|
||||||
DEBUG_PRINTF("entry\n");
|
DEBUG_PRINTF("entry\n");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user