summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-03-06 21:54:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-03-06 21:54:37 (GMT)
commit950d5f67e55c88bd2094c93e236c405ec3fde818 (patch)
treee9208f4d15b7dc7da675c90f0612caa27423354e
parent12b832c497b2fed905ba308f5d80ddf88a92102a (diff)
parent505efdc6148a12a025d319f4ff5f4e9bfb55e9b8 (diff)
downloadtcl-950d5f67e55c88bd2094c93e236c405ec3fde818.zip
tcl-950d5f67e55c88bd2094c93e236c405ec3fde818.tar.gz
tcl-950d5f67e55c88bd2094c93e236c405ec3fde818.tar.bz2
Cleaner error handling in fixempties().
-rw-r--r--generic/regc_nfa.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index af0bf3f..2fc3a05 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -1383,6 +1383,9 @@ fixempties(
}
s->tmp = NULL;
}
+ if (NISERR()) {
+ return;
+ }
/*
* Remove all the EMPTY arcs, since we don't need them anymore.
@@ -1402,14 +1405,14 @@ fixempties(
* 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);
}
}