Browse Source

Merge pull request #51473 from KoBeWi/some_crash_fix_idk

Fix crash when parsing Dictionary
Rémi Verschelde 4 years ago
parent
commit
b205a20bb1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      modules/gdscript/gdscript_parser.cpp

+ 3 - 1
modules/gdscript/gdscript_parser.cpp

@@ -2480,7 +2480,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
 			switch (dictionary->style) {
 			switch (dictionary->style) {
 				case DictionaryNode::LUA_TABLE:
 				case DictionaryNode::LUA_TABLE:
 					if (key != nullptr && key->type != Node::IDENTIFIER) {
 					if (key != nullptr && key->type != Node::IDENTIFIER) {
-						push_error("Expected identifier as dictionary key.");
+						push_error("Expected identifier as LUA-style dictionary key.");
+						advance();
+						break;
 					}
 					}
 					if (!match(GDScriptTokenizer::Token::EQUAL)) {
 					if (!match(GDScriptTokenizer::Token::EQUAL)) {
 						if (match(GDScriptTokenizer::Token::COLON)) {
 						if (match(GDScriptTokenizer::Token::COLON)) {