diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-06-19 01:11:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-19 01:11:03 +0200 |
commit | a9c53fa5994db8badb4ec14581bd8422fb340f41 (patch) | |
tree | e2a7722d6e5c34270b967c07aaa8e13aef6ad327 /modules/gdscript/gdscript_byte_codegen.cpp | |
parent | 9b0800cbf92f4165de2981f34dab6a55201fdcd9 (diff) | |
parent | b5f1e88b2ed7be4c0ecc9edf3f5d9f6287b7c513 (diff) |
Merge pull request #49287 from reduz/expose-variant-internal-binders
Make some Variant internal functions public.
Diffstat (limited to 'modules/gdscript/gdscript_byte_codegen.cpp')
-rw-r--r-- | modules/gdscript/gdscript_byte_codegen.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp index 6998cc5bb7..5a297cc50a 100644 --- a/modules/gdscript/gdscript_byte_codegen.cpp +++ b/modules/gdscript/gdscript_byte_codegen.cpp @@ -554,6 +554,14 @@ void GDScriptByteCodeGenerator::write_unary_operator(const Address &p_target, Va void GDScriptByteCodeGenerator::write_binary_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand, const Address &p_right_operand) { if (HAS_BUILTIN_TYPE(p_left_operand) && HAS_BUILTIN_TYPE(p_right_operand)) { + if (p_target.mode == Address::TEMPORARY) { + Variant::Type result_type = Variant::get_operator_return_type(p_operator, p_left_operand.type.builtin_type, p_right_operand.type.builtin_type); + Variant::Type temp_type = temporaries[p_target.address].type; + if (result_type != temp_type) { + write_type_adjust(p_target, result_type); + } + } + // Gather specific operator. Variant::ValidatedOperatorEvaluator op_func = Variant::get_validated_operator_evaluator(p_operator, p_left_operand.type.builtin_type, p_right_operand.type.builtin_type); |