diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-12-01 10:21:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 10:21:21 +0100 |
commit | eb555d7559371963d846811260a11fb07dd72a3d (patch) | |
tree | a0b316461dafe0eae084ea8685dcb1c1e1f371a4 /modules/gdscript/gdscript_parser.cpp | |
parent | 0ff8742919af72c7412e63ef0f646cb4e7bd7d8f (diff) | |
parent | 8d2506e811148d6e716ec31886357a23e53dd42b (diff) | |
download | redot-engine-eb555d7559371963d846811260a11fb07dd72a3d.tar.gz |
Merge pull request #69303 from Chaosus/gds_fix_loops
Reset unassigned local variables to null in the loops
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-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 f8fe015c6b..f2aafe9f0c 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1835,9 +1835,9 @@ GDScriptParser::ForNode *GDScriptParser::parse_for() { } suite->add_local(SuiteNode::Local(n_for->variable, current_function)); } - suite->parent_for = n_for; n_for->loop = parse_suite(R"("for" block)", suite); + n_for->loop->is_loop = true; complete_extents(n_for); // Reset break/continue state. @@ -2169,6 +2169,7 @@ GDScriptParser::WhileNode *GDScriptParser::parse_while() { is_continue_match = false; n_while->loop = parse_suite(R"("while" block)"); + n_while->loop->is_loop = true; complete_extents(n_while); // Reset break/continue state. |