diff --git a/rpcs3/util/fixed_typemap.hpp b/rpcs3/util/fixed_typemap.hpp index c793f6981c..7e468a4beb 100644 --- a/rpcs3/util/fixed_typemap.hpp +++ b/rpcs3/util/fixed_typemap.hpp @@ -21,11 +21,11 @@ namespace stx template static void call_ctor(void*& ptr) noexcept { - // Call default constructor only if available - if constexpr (std::is_default_constructible_v) + // Don't overwrite if already exists + if (!ptr) { - // Don't overwrite if already exists - if (!ptr) + // Call default constructor only if available + if constexpr (std::is_default_constructible_v) { ptr = new T(); }