From ddbb4878f2936f23570087cd2d3969432fbf40e5 Mon Sep 17 00:00:00 2001 From: cdemirer <41021322+cdemirer@users.noreply.github.com> Date: Wed, 26 Jan 2022 07:24:37 +0800 Subject: Fix array variant reuse in constructor --- core/variant/variant_construct.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/variant/variant_construct.h b/core/variant/variant_construct.h index b03f4a8d3b..cc98226bc6 100644 --- a/core/variant/variant_construct.h +++ b/core/variant/variant_construct.h @@ -344,7 +344,7 @@ public: return; } - VariantTypeChanger::change(&r_ret); + r_ret = Array(); Array &dst_arr = *VariantGetInternalPtr::get_ptr(&r_ret); const T &src_arr = *VariantGetInternalPtr::get_ptr(p_args[0]); @@ -356,7 +356,7 @@ public: } static inline void validated_construct(Variant *r_ret, const Variant **p_args) { - VariantTypeChanger::change(r_ret); + *r_ret = Array(); Array &dst_arr = *VariantGetInternalPtr::get_ptr(r_ret); const T &src_arr = *VariantGetInternalPtr::get_ptr(p_args[0]); -- cgit v1.2.3