From 7f4a806118f0c5089d425437bed5d75df1038dd6 Mon Sep 17 00:00:00 2001 From: "Hong, Yang A" Date: Thu, 4 Mar 2021 17:00:34 +0000 Subject: [PATCH] mcclellan: improve wide-state checking in Sherman optimization fixes github issue #305 --- src/nfa/mcclellancompile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nfa/mcclellancompile.cpp b/src/nfa/mcclellancompile.cpp index 27ec1716..432c7fd3 100644 --- a/src/nfa/mcclellancompile.cpp +++ b/src/nfa/mcclellancompile.cpp @@ -1082,7 +1082,9 @@ void find_better_daddy(dfa_info &info, dstate_id_t curr_id, bool using8bit, // Use the daddy already set for this state so long as it isn't already // a Sherman state. dstate_id_t daddy = currState.daddy; - if (!info.is_sherman(daddy) && !info.is_widestate(daddy)) { + if (info.is_widestate(daddy)) { + return; + } else if (!info.is_sherman(daddy)) { hinted.insert(currState.daddy); } else { // Fall back to granddaddy, which has already been processed (due