From: Alex Coyte Date: Fri, 30 Oct 2015 05:20:18 +0000 (+1100) Subject: doComponent: make it obvious that a is never null X-Git-Tag: v4.1.0^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b6ad2a01a6966f94332854c877d35511d421a79;p=thirdparty%2Fvectorscan.git doComponent: make it obvious that a is never null --- diff --git a/src/nfagraph/ng_puff.cpp b/src/nfagraph/ng_puff.cpp index cd190171..501d8f7b 100644 --- a/src/nfagraph/ng_puff.cpp +++ b/src/nfagraph/ng_puff.cpp @@ -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