From 8054735cab406d00d790131cde7b1ff026cc13ee Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 18 Sep 2019 02:50:32 +0300 Subject: [PATCH] Fix manual_fixed_typemap::init result (g_fxo) Return uncasted pointer to created type --- rpcs3/util/fixed_typemap.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/util/fixed_typemap.hpp b/rpcs3/util/fixed_typemap.hpp index 5d782ea39f..d1bcd3d5d0 100644 --- a/rpcs3/util/fixed_typemap.hpp +++ b/rpcs3/util/fixed_typemap.hpp @@ -94,7 +94,7 @@ namespace stx // Explicitly (re)initialize object of type T possibly with dynamic type As and arguments template - T* init(Args&&... args) noexcept + As* init(Args&&... args) noexcept { auto& ptr = m_list[stx::type_counter::template type>.index()]; @@ -103,8 +103,8 @@ namespace stx delete static_cast(ptr); } - auto* obj = static_cast(new std::decay_t(std::forward(args)...)); - ptr = obj; + As* obj = new std::decay_t(std::forward(args)...); + ptr = static_cast(obj); return obj; }