浏览代码

Make container element type comparison safe

Yuri Sizov 2 年之前
父节点
当前提交
f1e79e2581
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/gdscript/gdscript_analyzer.cpp

+ 1 - 1
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;