]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
fdr_confirm: remove complex confirm
authorJustin Viiret <justin.viiret@intel.com>
Mon, 22 May 2017 03:59:16 +0000 (13:59 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 00:38:59 +0000 (10:38 +1000)
src/fdr/fdr_confirm.h
src/fdr/fdr_confirm_compile.cpp
src/fdr/fdr_confirm_runtime.h

index 6ce85afd033d0ce89c7d67d7ebf51b4bba3e03a5..7f73ea13441579a39908e3bfd758245cee216de4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -46,7 +46,6 @@ typedef enum LitInfoFlags {
     NoFlags = 0,
     Caseless = 1,
     NoRepeat = 2,
-    ComplexConfirm = 4
 } LitInfoFlags;
 
 /**
@@ -63,7 +62,6 @@ struct LitInfo {
     u8 size;
     u8 flags; /* LitInfoFlags */
     u8 next;
-    u8 extended_size;
 };
 
 #define FDRC_FLAG_NO_CONFIRM 1
index b14ffb4291f746d63c48335ea790dec6df3a7a6a..3594ed4aee3dda242d68e4a533ab94da55c2d064 100644 (file)
@@ -99,12 +99,8 @@ void fillLitInfo(const vector<hwlmLiteral> &lits, vector<LitInfo> &tmpLitInfo,
         if (lit.noruns) {
             flags |= NoRepeat;
         }
-        if (lit.msk.size() > lit.s.size()) {
-            flags |= ComplexConfirm;
-            info.extended_size = verify_u8(lit.msk.size());
-        }
         info.flags = flags;
-        info.size = verify_u8(lit.s.size());
+        info.size = verify_u8(max(lit.msk.size(), lit.s.size()));
         info.groups = lit.groups;
 
         // these are built up assuming a LE machine
index a0603c929cc4e81681e27cadac76233540b404b2..ace54543125ac8c9b55e1f64b561637f65cc068d 100644 (file)
@@ -86,17 +86,6 @@ void confWithBit(const struct FDRConfirm *fdrc, const struct FDR_Runtime_Args *a
             goto out;
         }
 
-        if (unlikely(li->flags & ComplexConfirm)) {
-            const u8 *loc2 = buf + i - li->extended_size + 1;
-            if (loc2 < buf) {
-                u32 full_overhang = buf - loc2;
-                size_t len_history = a->len_history;
-                if (full_overhang > len_history) {
-                    goto out;
-                }
-            }
-        }
-
         *last_match = li->id;
         *control = a->cb(loc - buf, i, li->id, a->ctxt);
     out: