diff options
| author | dgp@users.sourceforge.net <dgp> | 2013-03-06 21:51:23 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2013-03-06 21:51:23 (GMT) |
| commit | a287facf365461ac34656c2869f17d863efc458c (patch) | |
| tree | 9f5ffc19b8ad3831c9e6e91b4a81dc56615cca3a | |
| parent | 4acfea9d3fd23f19a50e6419ef683b1ff653f0e8 (diff) | |
| download | tcl-a287facf365461ac34656c2869f17d863efc458c.zip tcl-a287facf365461ac34656c2869f17d863efc458c.tar.gz tcl-a287facf365461ac34656c2869f17d863efc458c.tar.bz2 | |
Cleaner error handling in fixempties().
| -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); } |
