summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorcdemirer <41021322+cdemirer@users.noreply.github.com>2022-01-26 07:24:37 +0800
committercdemirer <41021322+cdemirer@users.noreply.github.com>2022-01-26 07:24:37 +0800
commitddbb4878f2936f23570087cd2d3969432fbf40e5 (patch)
treedf2696fc1346647fa29e70ba211bb9d561f6a074 /core/variant
parent0f6a6ca5be1d674a6dfce03684bbf469d77e5e63 (diff)
Fix array variant reuse in constructor
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/variant_construct.h4
1 files 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<Array>::change(&r_ret);
+ r_ret = Array();
Array &dst_arr = *VariantGetInternalPtr<Array>::get_ptr(&r_ret);
const T &src_arr = *VariantGetInternalPtr<T>::get_ptr(p_args[0]);
@@ -356,7 +356,7 @@ public:
}
static inline void validated_construct(Variant *r_ret, const Variant **p_args) {
- VariantTypeChanger<Array>::change(r_ret);
+ *r_ret = Array();
Array &dst_arr = *VariantGetInternalPtr<Array>::get_ptr(r_ret);
const T &src_arr = *VariantGetInternalPtr<T>::get_ptr(p_args[0]);