diff options
author | SaracenOne <SaracenOne@gmail.com> | 2022-02-18 12:52:46 +0000 |
---|---|---|
committer | SaracenOne <SaracenOne@gmail.com> | 2022-02-18 12:52:46 +0000 |
commit | ae0026bc7b0b33195a2f8c5a8e85afd2127ffd05 (patch) | |
tree | e2a65ef3871620708fb10dd330e7b7c50c9f2248 /modules/gdscript | |
parent | 887d4bd0d985979d6c3fb33b053ce99486879956 (diff) |
Make 'is_attribute' false during parse error to prevent crash
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 8e4e457ec1..725b62f6d6 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2692,12 +2692,13 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_attribute(ExpressionNode * } } - attribute->is_attribute = true; attribute->base = p_previous_operand; if (!consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected identifier after "." for attribute access.)")) { return attribute; } + + attribute->is_attribute = true; attribute->attribute = parse_identifier(); return attribute; |