From 583f2e7612456e24f62ff21186c76c9acb8b8058 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Tue, 15 Oct 2024 17:31:06 -0700 Subject: [PATCH] Check interleaved and sequential in debug mode --- ConflictSet.cpp | 9 +++++++++ LongestCommonPrefix.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index e7e648e..cf25030 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -4242,6 +4242,15 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { inProgress->continuation(inProgress, &context); } +#ifndef NDEBUG + Arena arena; + auto *results2 = new (arena) Result[count]; + CheckContext context2; + context.tls.impl = this; + useSequential(reads, results2, count, context2); + assert(memcmp(result, results2, count) == 0); +#endif + #else useSequential(reads, result, count, context); #endif diff --git a/LongestCommonPrefix.h b/LongestCommonPrefix.h index 5490f97..98da7c2 100644 --- a/LongestCommonPrefix.h +++ b/LongestCommonPrefix.h @@ -129,7 +129,7 @@ longestCommonPrefix(const uint8_t *ap, const uint8_t *bp, int cl) { } int i = 0; - int end; + int end; // GCOVR_EXCL_LINE // kStride * kUnrollCount at a time end = cl & ~(kStride * kUnrollFactor - 1);