summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2006-09-27 23:35:00 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2006-09-27 23:35:00 (GMT)
commit542215ff7f7979ba967987a746cfa8dd723425c6 (patch)
treeee39b9892f7f31b268ddf1be96f7e575475f35d1
parentf2bc477e968be829da18b8a9e84c8e7a3029b386 (diff)
downloadtcl-542215ff7f7979ba967987a746cfa8dd723425c6.zip
tcl-542215ff7f7979ba967987a746cfa8dd723425c6.tar.gz
tcl-542215ff7f7979ba967987a746cfa8dd723425c6.tar.bz2
* generic/regc_color.c (uncolorchain):
* generic/regc_nfa.c (freearc): changed tests and asserts to equivalent formulation, designed to avoid an explicit comparison to NULL and satisfy coverity that 6 and 9 are not bugs.
-rw-r--r--ChangeLog5
-rw-r--r--generic/regc_color.c5
-rw-r--r--generic/regc_nfa.c4
3 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ded99e1..645e262 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,11 @@
REGEXP_MCCE_ENABLE.
This silences coverity bugs 7, 16, 80
+ * generic/regc_color.c (uncolorchain):
+ * generic/regc_nfa.c (freearc): changed tests and asserts to
+ equivalent formulation, designed to avoid an explicit comparison
+ to NULL and satisfy coverity that 6 and 9 are not bugs.
+
2006-09-27 Andreas Kupries <andreask@activestate.com>
* tests/pkg.test: Added test for version comparison at the 32bit
diff --git a/generic/regc_color.c b/generic/regc_color.c
index f1f216f..1a7eeda 100644
--- a/generic/regc_color.c
+++ b/generic/regc_color.c
@@ -673,10 +673,11 @@ uncolorchain(
if (aa == a) { /* easy case */
cd->arcs = a->colorchain;
} else {
- for (; aa != NULL && aa->colorchain != a; aa = aa->colorchain) {
+ assert(aa != NULL);
+ for (; aa->colorchain != a; aa = aa->colorchain) {
+ assert(aa->colorchain != NULL);
continue;
}
- assert(aa != NULL);
aa->colorchain = a->colorchain;
}
a->colorchain = NULL; /* paranoia */
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 12a016e..d5e7e01 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -409,10 +409,10 @@ freearc(
if (a == victim) { /* simple case: first in chain */
to->ins = victim->inchain;
} else {
- for (; a != NULL && a->inchain != victim; a = a->inchain) {
+ for (; a->inchain != victim; a = a->inchain) {
+ assert(a->inchain != NULL);
continue;
}
- assert(a != NULL);
a->inchain = victim->inchain;
}
to->nins--;