Merge pull request #55214 from Scony/fix-gdscript-crash-2

Fix GDScript parser crash on 'dollar mixed with assignment' expression
This commit is contained in:
Rémi Verschelde 2022-01-22 20:30:54 +01:00 committed by GitHub
commit 182a36db47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -2415,6 +2415,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_assignment(ExpressionNode
push_error("Assignment is not allowed inside an expression.");
return parse_expression(false); // Return the following expression.
}
if (p_previous_operand == nullptr) {
return parse_expression(false); // Return the following expression.
}
#ifdef DEBUG_ENABLED
VariableNode *source_variable = nullptr;

View File

@ -0,0 +1,2 @@
func test():
$=$

View File

@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expect node path as string or identifier after "$".