summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitrii Maganov <vonagam@gmail.com>2023-02-14 16:57:21 +0200
committerDmitrii Maganov <vonagam@gmail.com>2023-02-14 17:01:21 +0200
commitdf6aae2eca641c6a6960a7ae39d6d59c18f3b729 (patch)
tree870d3cca50d20ea57a28b07728f16a6d3cc258fc
parent830eff64a75a9cad211a60e91a2d804592d4d7e8 (diff)
GDScript: Fix missing unsafety mark for binary op with weak variables
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
1 files changed, 2 insertions, 0 deletions
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.");