diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-06-20 17:39:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-20 17:39:08 +0200 |
commit | d7af287ce3108f74799a7d0efd59b454253f6f68 (patch) | |
tree | b88f9f016026990c141635ce18a18b4a0a3e12e2 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 248e5245e41ed80069eca12fcb523092fe848f28 (diff) | |
parent | f1e79e2581047f954cd7739f2c5f7c45775131ae (diff) | |
download | redot-engine-d7af287ce3108f74799a7d0efd59b454253f6f68.tar.gz |
Merge pull request #78478 from YuriSizov/gdscript-fix-container-element-cmp
Make container element type comparison safe
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 18917ddc32..9d39cbf1a5 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -5003,7 +5003,7 @@ GDScriptParser::DataType GDScriptAnalyzer::get_operation_type(Variant::Operator bool hard_operation = p_a.is_hard_type() && p_b.is_hard_type(); if (p_operation == Variant::OP_ADD && a_type == Variant::ARRAY && b_type == Variant::ARRAY) { - if (p_a.get_container_element_type() == p_a.get_container_element_type()) { + if (p_a.has_container_element_type() && p_b.has_container_element_type() && p_a.get_container_element_type() == p_b.get_container_element_type()) { r_valid = true; result = p_a; result.type_source = hard_operation ? GDScriptParser::DataType::ANNOTATED_INFERRED : GDScriptParser::DataType::INFERRED; |