Sfoglia il codice sorgente

Fix crash with non-constant keys in match statement Dictionary pattern

cdemirer 3 anni fa
parent
commit
28ac4d8b7d
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      modules/gdscript/gdscript_analyzer.cpp

+ 1 - 1
modules/gdscript/gdscript_analyzer.cpp

@@ -1586,7 +1586,7 @@ void GDScriptAnalyzer::resolve_match_pattern(GDScriptParser::PatternNode *p_matc
 				if (p_match_pattern->dictionary[i].key) {
 				if (p_match_pattern->dictionary[i].key) {
 					reduce_expression(p_match_pattern->dictionary[i].key);
 					reduce_expression(p_match_pattern->dictionary[i].key);
 					if (!p_match_pattern->dictionary[i].key->is_constant) {
 					if (!p_match_pattern->dictionary[i].key->is_constant) {
-						push_error(R"(Expression in dictionary pattern key must be a constant.)", p_match_pattern->expression);
+						push_error(R"(Expression in dictionary pattern key must be a constant.)", p_match_pattern->dictionary[i].key);
 					}
 					}
 				}
 				}