From 24ecdef8443cad648d57c5cda74598760108bb54 Mon Sep 17 00:00:00 2001 From: Scott Vokes Date: Wed, 30 Oct 2024 09:40:46 -0400 Subject: [PATCH] cdata: Fix nesting for end-of-match eager_output check. --- src/libfsm/print/cdata.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libfsm/print/cdata.c b/src/libfsm/print/cdata.c index a5a55cafc..7ce176c1a 100644 --- a/src/libfsm/print/cdata.c +++ b/src/libfsm/print/cdata.c @@ -710,7 +710,13 @@ generate_interpreter(FILE *f, const struct cdata_config *config, const struct fs } /* If the end state has eager_outputs, set their flags. */ - generate_eager_output_check(f, config, prefix); + if (has_eager_outputs) { + fprintf(f, "\t{\n"); /* add {} nesting so the tabs match */ + fprintf(f, "\t\tconst struct %s_cdata_state *state = &%s_dfa_data.states[cur_state];\n", + prefix, prefix); + generate_eager_output_check(f, config, prefix); + fprintf(f, "\t}\n"); + } /* Got a match. */ fprintf(f, "\treturn 1; /* match */\n");