summaryrefslogtreecommitdiffstats
path: root/generic/regc_nfa.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-03-06 21:51:23 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-03-06 21:51:23 (GMT)
commit139ae23a7aa130079273b16f7e9117191593d573 (patch)
tree9f5ffc19b8ad3831c9e6e91b4a81dc56615cca3a /generic/regc_nfa.c
parent738fb829521fa90bc35e8689aa6c6333a95e314c (diff)
downloadtcl-139ae23a7aa130079273b16f7e9117191593d573.zip
tcl-139ae23a7aa130079273b16f7e9117191593d573.tar.gz
tcl-139ae23a7aa130079273b16f7e9117191593d573.tar.bz2
Cleaner error handling in fixempties().
Diffstat (limited to 'generic/regc_nfa.c')
-rw-r--r--generic/regc_nfa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 107e466..eea4317 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -1274,6 +1274,8 @@ FILE *f; /* for debug output; NULL none */
}
s->tmp = NULL;
}
+ if (NISERR())
+ return;
/*
* Remove all the EMPTY arcs, since we don't need them anymore.
@@ -1291,13 +1293,13 @@ FILE *f; /* for debug output; NULL none */
* tried to combine it with the previous step; but cleanup()
* will take care of anything we miss.)
*/
- for (s = nfa->states; s != NULL && !NISERR(); s = nexts) {
+ for (s = nfa->states; s != NULL; s = nexts) {
nexts = s->next;
if ((s->nins == 0 || s->nouts == 0) && !s->flag)
dropstate(nfa, s);
}
- if (f != NULL && !NISERR())
+ if (f != NULL)
dumpnfa(nfa, f);
}