]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
mcclellan: improve wide-state checking in Sherman optimization
authorHong, Yang A <yang.a.hong@intel.com>
Thu, 4 Mar 2021 17:00:34 +0000 (17:00 +0000)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Mon, 29 Aug 2022 12:03:06 +0000 (15:03 +0300)
fixes github issue #305

src/nfa/mcclellancompile.cpp

index b5c3a8ac656b44a3b826d0cbd799f93171383eae..aa04e47014907b18eed3c4911b1ffac3374694f9 100644 (file)
@@ -1081,7 +1081,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