]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
doComponent: make it obvious that a is never null
authorAlex Coyte <a.coyte@intel.com>
Fri, 30 Oct 2015 05:20:18 +0000 (16:20 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 10 Nov 2015 03:25:05 +0000 (14:25 +1100)
src/nfagraph/ng_puff.cpp

index cd190171044e13a912624130a3d7115e7a63b635..501d8f7b25cc0d64f6bf1ee329182029a495d300 100644 (file)
@@ -316,7 +316,7 @@ bool doComponent(RoseBuild &rose, ReportManager &rm, NGHolder &g, NFAVertex a,
     bool unbounded = false;
     bool exhaustible = can_exhaust(g, rm);
 
-    while (a) {
+    while (true) {
         if (is_special(a, g)) {
             DEBUG_PRINTF("stopped puffing due to special vertex\n");
             break;
@@ -350,9 +350,7 @@ bool doComponent(RoseBuild &rose, ReportManager &rm, NGHolder &g, NFAVertex a,
 
         a = getSoleSourceVertex(g, a);
 
-        if (!a) {
-            break;
-        }
+        assert(a); /* already checked that old a had a proper in degree of 1 */
 
         // Snark: we can't handle this case, because we can only handle a
         // single report ID on a vertex