From bbd308a908bc60b3ffef58777c70bb5fdc5a0585 Mon Sep 17 00:00:00 2001 From: oltolm Date: Fri, 17 Feb 2023 01:29:24 +0100 Subject: [PATCH] fix order of static initialization: add comment --- rpcs3/Emu/Cell/PPUModule.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 352d9e6931..98dd4ddda5 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -39,6 +39,8 @@ extern void sys_initialize_tls(ppu_thread&, u64, u32, u32, u32); std::unordered_map& ppu_module_manager::get() { + // In C++ the order of static initialization is undefined if it happens in + // separate compilation units, therefore we have to initialize the map on first use. static std::unordered_map s_module_map; return s_module_map; }