From af661b2621d1167bd6fd612fb3f139a4168d1caf Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Sat, 1 Jun 2024 16:43:34 +0200 Subject: [PATCH] agi: Replace Boost flat_map with std::map in Thesaurus class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I do not see a reason to prefer the flat_map implementation, and it’s causing crashes when compiled with GCC >= 13 and Boost 1.85.0 at optimization level 2 or higher. Whether or not this is a bug in GCC, or Boost hitting a case of undefined behavior, avoiding it altogether doesn’t seem to hurt. Fixes #137 --- libaegisub/include/libaegisub/thesaurus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libaegisub/include/libaegisub/thesaurus.h b/libaegisub/include/libaegisub/thesaurus.h index 887d59b13..45bc368d0 100644 --- a/libaegisub/include/libaegisub/thesaurus.h +++ b/libaegisub/include/libaegisub/thesaurus.h @@ -14,7 +14,7 @@ #include "fs_fwd.h" -#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace charset { class IconvWrapper; } class Thesaurus { /// Map of word -> byte position in the data file - boost::container::flat_map offsets; + std::map offsets; /// Read handle to the data file std::unique_ptr dat; /// Converter from the data file's charset to UTF-8