From df6aae2eca641c6a6960a7ae39d6d59c18f3b729 Mon Sep 17 00:00:00 2001 From: Dmitrii Maganov Date: Tue, 14 Feb 2023 16:57:21 +0200 Subject: GDScript: Fix missing unsafety mark for binary op with weak variables --- modules/gdscript/gdscript_analyzer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/gdscript') diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index de0dacece3..65b47de9ef 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -2598,6 +2598,8 @@ void GDScriptAnalyzer::reduce_binary_op(GDScriptParser::BinaryOpNode *p_binary_o result = get_operation_type(p_binary_op->variant_op, left_type, right_type, valid, p_binary_op); if (!valid) { push_error(vformat(R"(Invalid operands "%s" and "%s" for "%s" operator.)", left_type.to_string(), right_type.to_string(), Variant::get_operator_name(p_binary_op->variant_op)), p_binary_op); + } else if (result.type_source != GDScriptParser::DataType::ANNOTATED_EXPLICIT) { + mark_node_unsafe(p_binary_op); } } else { ERR_PRINT("Parser bug: unknown binary operation."); -- cgit v1.2.3