mcclellan: fix dump issue in wide-state case.

This commit is contained in:
Hong, Yang A 2019-01-18 00:20:06 +08:00 committed by Chang, Harry
parent f68723a606
commit b5a8644b1f

View File

@ -275,7 +275,8 @@ void nfaExecMcClellan16_dumpDot(const NFA *nfa, FILE *f) {
dumpDotPreambleDfa(f);
for (u16 i = 1; i < m->state_count; i++) {
u16 sherman_ceil = m->has_wide == 1 ? m->wide_limit : m->state_count;
for (u16 i = 1; i < sherman_ceil; i++) {
describeNode(nfa, m, i, f);
u16 t[ALPHABET_SIZE];
@ -314,7 +315,8 @@ void dumpAccelMasks(FILE *f, const mcclellan *m, const mstate_aux *aux) {
fprintf(f, "Acceleration\n");
fprintf(f, "------------\n");
for (u16 i = 0; i < m->state_count; i++) {
u16 sherman_ceil = m->has_wide == 1 ? m->wide_limit : m->state_count;
for (u16 i = 0; i < sherman_ceil; i++) {
if (!aux[i].accel_offset) {
continue;
}
@ -360,7 +362,8 @@ void dumpCommonHeader(FILE *f, const mcclellan *m) {
static
void dumpTransitions(FILE *f, const NFA *nfa, const mcclellan *m,
const mstate_aux *aux) {
for (u16 i = 0; i < m->state_count; i++) {
u16 sherman_ceil = m->has_wide == 1 ? m->wide_limit : m->state_count;
for (u16 i = 0; i < sherman_ceil; i++) {
fprintf(f, "%05hu", i);
if (aux[i].accel_offset) {
dumpAccelText(f, (const union AccelAux *)((const char *)m +