From 49eae742721b85e01d8035c1d4d7d83dd23e11f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Tue, 30 May 2023 09:08:19 -0300 Subject: [PATCH] assert that FName is a POD and as such is passed directly on registers, so that if it changes to be a non-pod, it won't silently break parameters --- src/common/scripting/vm/vm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/scripting/vm/vm.h b/src/common/scripting/vm/vm.h index 1a8706353..ca13763f9 100644 --- a/src/common/scripting/vm/vm.h +++ b/src/common/scripting/vm/vm.h @@ -45,6 +45,7 @@ #include "memarena.h" #include "name.h" #include "scopebarrier.h" +#include class DObject; union VMOP; @@ -617,7 +618,7 @@ namespace template struct native_is_valid { static const bool value = true; static const bool retval = true; }; template<> struct native_is_valid { static const bool value = true; static const bool retval = true; }; template<> struct native_is_valid { static const bool value = true; static const bool retval = true; }; - template<> struct native_is_valid { static const bool value = true; static const bool retval = true; static_assert(sizeof(FName) == sizeof(int)); }; + template<> struct native_is_valid { static const bool value = true; static const bool retval = true; static_assert(sizeof(FName) == sizeof(int)); static_assert(std::is_pod_v);}; template<> struct native_is_valid { static const bool value = true; static const bool retval = true; }; template<> struct native_is_valid { static const bool value = true; static const bool retval = true; }; template<> struct native_is_valid { static const bool value = true; static const bool retval = false;}; // Bool as return does not work!