summaryrefslogtreecommitdiffstats
path: root/generic
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)
commit505efdc6148a12a025d319f4ff5f4e9bfb55e9b8 (patch)
tree9f5ffc19b8ad3831c9e6e91b4a81dc56615cca3a /generic
parent3a585d27744e01939ee63c2db6ea6b2ece7798e1 (diff)
downloadtcl-505efdc6148a12a025d319f4ff5f4e9bfb55e9b8.zip
tcl-505efdc6148a12a025d319f4ff5f4e9bfb55e9b8.tar.gz
tcl-505efdc6148a12a025d319f4ff5f4e9bfb55e9b8.tar.bz2
Cleaner error handling in fixempties().
Diffstat (limited to 'generic')
-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);
}