summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-01-22 20:31:45 +0100
committerGitHub <noreply@github.com>2022-01-22 20:31:45 +0100
commitb5f524d4c01001a578ce9a15558a32d70c8687ea (patch)
tree157a46262e5a4c151687ab4ac775aadb89cef0b5 /modules/gdscript/gdscript_parser.cpp
parent182a36db47b1cf935feef69bffde6c0f285a63ec (diff)
parent3eec759e8715afe41002f893c528df78ffbe6220 (diff)
downloadredot-engine-b5f524d4c01001a578ce9a15558a32d70c8687ea.tar.gz
Merge pull request #55433 from V-Sekai/prev_operand_nullptr_check
Check for nullptr expression in parse_precedence function
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 05253caa8f..460bd85a86 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -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.