summaryrefslogtreecommitdiffstats
path: root/generic/regc_nfa.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-03-06 21:55:29 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-03-06 21:55:29 (GMT)
commit121e90a73db69eff2a2c317545416c7a0308d8eb (patch)
tree441e4228d17408e9b1960cceb8cf2b912148e1a9 /generic/regc_nfa.c
parent00c156ae97119b21fbc1767be80257dd8c882d31 (diff)
parent950d5f67e55c88bd2094c93e236c405ec3fde818 (diff)
downloadtcl-121e90a73db69eff2a2c317545416c7a0308d8eb.zip
tcl-121e90a73db69eff2a2c317545416c7a0308d8eb.tar.gz
tcl-121e90a73db69eff2a2c317545416c7a0308d8eb.tar.bz2
Cleaner error handling in fixempties().
Diffstat (limited to 'generic/regc_nfa.c')
-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 2fe2b27..fc0c823 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -1396,6 +1396,9 @@ fixempties(
}
s->tmp = NULL;
}
+ if (NISERR()) {
+ return;
+ }
/*
* Remove all the EMPTY arcs, since we don't need them anymore.
@@ -1415,14 +1418,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);
}
}