Index: ps/trunk/source/graphics/PreprocessorWrapper.cpp =================================================================== --- ps/trunk/source/graphics/PreprocessorWrapper.cpp +++ ps/trunk/source/graphics/PreprocessorWrapper.cpp @@ -24,6 +24,7 @@ #include "ps/Profile.h" #include +#include #include #include #include @@ -109,7 +110,7 @@ bool ResolveIncludesImpl( std::string_view currentPart, std::unordered_map& includeCache, const CPreprocessorWrapper::IncludeRetrieverCallback& includeCallback, - std::vector& chunks, std::vector& processedParts) + std::deque& chunks, std::vector& processedParts) { static const CStr lineDirective = "#line "; for (size_t lineStart = 0, line = 1; lineStart < currentPart.size(); ++line) @@ -229,7 +230,9 @@ // Stores intermediate blocks of text to avoid additional copying. Should // be constructed before views and destroyed after (currently guaranteed // by stack). - std::vector chunks; + // Short String Optimisation can make views point to container-managed data, + // so push_back must not invalidate pointers (std::deque guarantees that). + std::deque chunks; // After resolving the following vector should contain a complete list // to concatenate. std::vector processedParts;