]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
ensure that we add default top when creating a new infix graph
authorAlex Coyte <a.coyte@intel.com>
Sun, 15 Jan 2017 23:58:31 +0000 (10:58 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 17 Jan 2017 00:39:04 +0000 (11:39 +1100)
src/nfagraph/ng_rose.cpp

index 1c4163cea7c38115c5a3b747222974908ee84585..7066ab27d9d22b5de39be8f05463447d2744675b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -2368,12 +2368,17 @@ void makeNocaseWithPrefixMask(RoseInGraph &g, RoseInVertex v) {
 
                 h[ds].char_reach = CharReach::dot();
 
-                add_edge(h.start, ds, h);
+                NFAEdge e_start_to_ds = add_edge(h.start, ds, h);
                 add_edge(ds, ds, h);
                 add_edge(ds, h.accept, h);
                 h[h.start].reports.insert(0);
                 h[ds].reports.insert(0);
+
+                if (g[u].type == RIV_LITERAL) {
+                    h[e_start_to_ds].tops.insert(DEFAULT_TOP);
+                }
             } else {
+                assert(g[u].type == RIV_ANCHORED_START);
                 add_edge(h.start, h.accept, h);
                 h[h.start].reports.insert(0);
             }