From 505efdc6148a12a025d319f4ff5f4e9bfb55e9b8 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 6 Mar 2013 21:51:23 +0000 Subject: Cleaner error handling in fixempties(). --- generic/regc_nfa.c | 6 ++++-- 1 file 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); } -- cgit v0.12