diff options
author | dgp <dgp@users.sourceforge.net> | 2013-03-06 21:54:37 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-03-06 21:54:37 (GMT) |
commit | 1bee0d67c61e4dc246096381d0864a557a57f061 (patch) | |
tree | e9208f4d15b7dc7da675c90f0612caa27423354e /generic/regc_nfa.c | |
parent | 7cd2194d47544ff9fd16acbe50e44b443c1bb70b (diff) | |
parent | 139ae23a7aa130079273b16f7e9117191593d573 (diff) | |
download | tcl-1bee0d67c61e4dc246096381d0864a557a57f061.zip tcl-1bee0d67c61e4dc246096381d0864a557a57f061.tar.gz tcl-1bee0d67c61e4dc246096381d0864a557a57f061.tar.bz2 |
Cleaner error handling in fixempties().
Diffstat (limited to 'generic/regc_nfa.c')
-rw-r--r-- | generic/regc_nfa.c | 7 |
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); } } |