diff options
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/binder_common.h | 6 | ||||
-rw-r--r-- | core/variant/method_ptrcall.h | 2 | ||||
-rw-r--r-- | core/variant/variant.h | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h index ef5867c685..3cb2a6bfb5 100644 --- a/core/variant/binder_common.h +++ b/core/variant/binder_common.h @@ -69,17 +69,17 @@ struct VariantCaster<const T &> { template <> \ struct VariantCaster<m_enum> { \ static _FORCE_INLINE_ m_enum cast(const Variant &p_variant) { \ - return (m_enum)p_variant.operator int(); \ + return (m_enum)p_variant.operator int64_t(); \ } \ }; \ template <> \ struct PtrToArg<m_enum> { \ _FORCE_INLINE_ static m_enum convert(const void *p_ptr) { \ - return m_enum(*reinterpret_cast<const int *>(p_ptr)); \ + return m_enum(*reinterpret_cast<const int64_t *>(p_ptr)); \ } \ typedef int64_t EncodeT; \ _FORCE_INLINE_ static void encode(m_enum p_val, const void *p_ptr) { \ - *(int *)p_ptr = p_val; \ + *(int64_t *)p_ptr = p_val; \ } \ }; diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h index 7852187b77..8836e257a9 100644 --- a/core/variant/method_ptrcall.h +++ b/core/variant/method_ptrcall.h @@ -105,7 +105,7 @@ struct PtrToArg {}; } \ } -MAKE_PTRARGCONV(bool, uint32_t); +MAKE_PTRARGCONV(bool, uint8_t); // Integer types. MAKE_PTRARGCONV(uint8_t, int64_t); MAKE_PTRARGCONV(int8_t, int64_t); diff --git a/core/variant/variant.h b/core/variant/variant.h index 4dc706e853..780f9b4e70 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -118,6 +118,11 @@ public: VARIANT_MAX }; + enum { + // Maximum recursion depth allowed when serializing variants. + MAX_RECURSION_DEPTH = 1024, + }; + private: friend struct _VariantCall; friend class VariantInternal; |