2
0
Fork 0

Fixed crash when parsing an empty assignment.

Resolves #51620.
4.0
Louis Dumont 2021-08-25 18:32:24 +07:00
parent ee4a8e6a85
commit 79578a5625
3 changed files with 8 additions and 0 deletions

@ -2365,6 +2365,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_assignment(ExpressionNode
}
assignment->assignee = p_previous_operand;
assignment->assigned_value = parse_expression(false);
if (assignment->assigned_value == nullptr) {
push_error(R"(Expected an expression after "=".)");
}
#ifdef DEBUG_ENABLED
if (has_operator && source_variable != nullptr && source_variable->assignments == 0) {

@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected an expression after "=".