catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Avoid mixed-mode libc++ container annotations in Catch3 stream reuse: store released stream indices in a node-based list so ASan-instrumented clients can link the uninstrumented library without vector relocation false positives; preserve public API and third-party build flags
- Commit
febb5b1e244174da0985b9994f8d5ed1676950e8- Author
- Leitwolf11 ·
- Parents
a870d0a4b37c
Changes
src/catch2/internal/catch_reusable_string_stream.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/catch2/internal/catch_reusable_string_stream.cpp b/src/catch2/internal/catch_reusable_string_stream.cpp index 875da4da..c60618e9 100644 --- a/src/catch2/internal/catch_reusable_string_stream.cpp +++ b/src/catch2/internal/catch_reusable_string_stream.cpp @@ -11,6 +11,7 @@ #include <catch2/internal/catch_unique_ptr.hpp> #include <cstdio> +#include <list> #include <sstream> #include <tuple> #include <vector> @@ -20,7 +21,10 @@ namespace Catch { // This class encapsulates the idea of a pool of ostringstreams that can be reused. struct StringStreams { std::vector<Detail::unique_ptr<std::ostringstream>> m_streams; - std::vector<std::size_t> m_unused; + // The library can be linked into ASan-instrumented clients without + // instrumenting Catch3 itself. A list avoids mixed-mode libc++ vector + // container annotations for the reusable-index pool. + std::list<std::size_t> m_unused; std::ostringstream m_referenceStream; // Used for copy state/ flags from Detail::Mutex m_mutex;