Skip to content

Commit

Permalink
Merge pull request #78478 from YuriSizov/gdscript-fix-container-eleme…
Browse files Browse the repository at this point in the history
…nt-cmp

Make container element type comparison safe
  • Loading branch information
YuriSizov authored Jun 20, 2023
2 parents 248e524 + f1e79e2 commit d7af287
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/gdscript/gdscript_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d7af287

Please sign in to comment.