Fix crash with consecutive commas in Dictionary
This commit is contained in:
parent
1234c2bdd9
commit
c7452a9940
|
@ -2462,8 +2462,10 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
|
|||
push_error(R"(Expected "=" after dictionary key.)");
|
||||
}
|
||||
}
|
||||
key->is_constant = true;
|
||||
key->reduced_value = static_cast<IdentifierNode *>(key)->name;
|
||||
if (key != nullptr) {
|
||||
key->is_constant = true;
|
||||
key->reduced_value = static_cast<IdentifierNode *>(key)->name;
|
||||
}
|
||||
break;
|
||||
case DictionaryNode::PYTHON_DICT:
|
||||
if (!match(GDScriptTokenizer::Token::COLON)) {
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var dictionary = { hello = "world",, }
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression as dictionary key.
|
Loading…
Reference in New Issue