diff options
author | SaracenOne <SaracenOne@gmail.com> | 2021-11-29 09:53:11 +0000 |
---|---|---|
committer | SaracenOne <SaracenOne@gmail.com> | 2021-11-29 11:29:15 +0000 |
commit | 3eec759e8715afe41002f893c528df78ffbe6220 (patch) | |
tree | b5c541a1f7c814d532a3a8415a0524315df9652d /modules/gdscript | |
parent | 69a194f051c5f02243092e305633b9ffbd03b05f (diff) |
Check for nullptr expression in parse_precedence function
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 41b2d2191c..c50f9c9007 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2107,7 +2107,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. |