diff options
| author | Leitwolf11 | 2026-09-29 23:00:34 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-09-29 23:00:34 +0300 |
| commit | febb5b1e244174da0985b9994f8d5ed1676950e8 (patch) | |
| tree | 6cd5786e553f19a57056599466f1fa18d060ab4e /src | |
| parent | a870d0a4b37c2840db4eeaaaaf57b4eab4db75d3 (diff) | |
| download | catch3-febb5b1e244174da0985b9994f8d5ed1676950e8.tar.gz | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/internal/catch_reusable_string_stream.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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; |