diff options
author | dgp <dgp@users.sourceforge.net> | 2013-03-06 21:51:23 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-03-06 21:51:23 (GMT) |
commit | 505efdc6148a12a025d319f4ff5f4e9bfb55e9b8 (patch) | |
tree | 9f5ffc19b8ad3831c9e6e91b4a81dc56615cca3a /generic | |
parent | 3a585d27744e01939ee63c2db6ea6b2ece7798e1 (diff) | |
download | tcl-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.c | 6 |
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); } |