From 9948c57e1363f592a24eb846f85fb74fae49bcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 8 Oct 2026 00:10:39 +0200 Subject: [PATCH] Make MIPSState standard-layout again, so offsetof is valid Turns out that the actual problem here was "private", not the vector. --- Core/MIPS/MIPS.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/MIPS.h b/Core/MIPS/MIPS.h index c43c5f2a1b..2f5d26920d 100644 --- a/Core/MIPS/MIPS.h +++ b/Core/MIPS/MIPS.h @@ -20,6 +20,7 @@ #include "ppsspp_config.h" #include +#include #include #include "Common/CommonTypes.h" @@ -289,12 +290,16 @@ public: void ProcessPendingInvalidates(); -private: + // Don't make private, see the static_assert below. // Doesn't need save stating. std::vector pendingInvalidates_; bool invalidateAll_ = false; }; +// Access control ('private') break standard layout. Let's not allow it, to avoid excessive +// compiler warnings. +static_assert(std::is_standard_layout_v, "the JITs use offsetof on MIPSState"); + class MIPSDebugInterface; // The one we are compiling or running currently