diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-20 15:41:32 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-20 15:41:32 +0100 |
commit | 6bf63a3542f77443f3453bd02ac316d6c9de6f98 (patch) | |
tree | 817d1e93347ae16b3aa6bff284304b405a040363 | |
parent | 3e0a989bd1c3e592f23b49bc824441b038d862c6 (diff) | |
parent | df6aae2eca641c6a6960a7ae39d6d59c18f3b729 (diff) |
Merge pull request #73291 from vonagam/fix-unsafe-weak-binop
GDScript: Fix missing unsafety mark for binary op with weak variables
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index c8dfdbdd68..e86f2b8fff 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -2599,6 +2599,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."); |