]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
fix lastMatch<64>
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Fri, 23 Jul 2021 08:42:13 +0000 (11:42 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 12 Oct 2021 08:51:34 +0000 (11:51 +0300)
src/util/match.hpp

index ba72e2e9de7f6a0619c803586df22b59a7329ff5..b321f757d0f7d74b1058086cc4049c1d8ce55fe5 100644 (file)
@@ -120,7 +120,7 @@ const u8 *lastMatch<64>(const u8 *buf, typename SuperVector<64>::movemask_type z
         u32 pos = clz64(~z);
         DEBUG_PRINTF("match @ pos %u\n", pos);
         assert(pos < 64);
-        return buf + pos;
+        return buf + (63 - pos);
     } else {
         return NULL; // no match
     }