]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rdfa_merge: sort esets before alphabet calc
authorJustin Viiret <justin.viiret@intel.com>
Wed, 5 Apr 2017 06:40:07 +0000 (16:40 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:19:51 +0000 (15:19 +1000)
src/nfa/rdfa_merge.cpp

index 45457555ce1f57a64e8827dfab0313437d0e0235..50e9b62a03a4fc99305390bf0a603bce911556c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 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:
@@ -40,6 +40,7 @@
 #include "util/report_manager.h"
 #include "util/ue2_containers.h"
 
+#include <algorithm>
 #include <queue>
 
 using namespace std;
@@ -135,6 +136,10 @@ public:
             }
         }
 
+        // Sort so that our alphabet mapping isn't dependent on the order of
+        // rdfas passed in.
+        sort(esets.begin(), esets.end());
+
         alphasize = buildAlphabetFromEquivSets(esets, alpha, unalpha);
     }