Merge pull request #55433 from V-Sekai/prev_operand_nullptr_check

Check for nullptr expression in parse_precedence function
This commit is contained in:
Rémi Verschelde 2022-01-22 20:31:45 +01:00 committed by GitHub
commit b5f524d4c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2105,7 +2105,7 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_precedence(Precedence p_pr
ExpressionNode *previous_operand = (this->*prefix_rule)(nullptr, p_can_assign);
while (p_precedence <= get_rule(current.type)->precedence) {
if (p_stop_on_assign && current.type == GDScriptTokenizer::Token::EQUAL) {
if (previous_operand == nullptr || (p_stop_on_assign && current.type == GDScriptTokenizer::Token::EQUAL)) {
return previous_operand;
}
// Also switch multiline mode on here for infix operators.