summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-05-18 16:04:12 +0200
committerGitHub <noreply@github.com>2022-05-18 16:04:12 +0200
commite22255edaf1e48fffe71f6918814bbc2b089c278 (patch)
tree896df1a4be63b566e5554c04267bff2b861295bf /modules/gdscript/gdscript_parser.cpp
parent533e364ab5a672630beeff7fded4cf99f59567c9 (diff)
parent86c0e38e8f13f7f5ac4ed30570a3ae2556b9fca7 (diff)
downloadredot-engine-e22255edaf1e48fffe71f6918814bbc2b089c278.tar.gz
Merge pull request #55201 from Scony/fix-unreachable-code-false-positive
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r--modules/gdscript/gdscript_parser.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 8563f2b432..96d1f68f60 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -1808,7 +1808,6 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
#ifdef DEBUG_ENABLED
bool all_have_return = true;
bool have_wildcard = false;
- bool wildcard_has_return = false;
bool have_wildcard_without_continue = false;
#endif
@@ -1826,9 +1825,6 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
if (branch->has_wildcard) {
have_wildcard = true;
- if (branch->block->has_return) {
- wildcard_has_return = true;
- }
if (!branch->block->has_continue) {
have_wildcard_without_continue = true;
}
@@ -1843,7 +1839,7 @@ GDScriptParser::MatchNode *GDScriptParser::parse_match() {
consume(GDScriptTokenizer::Token::DEDENT, R"(Expected an indented block after "match" statement.)");
#ifdef DEBUG_ENABLED
- if (wildcard_has_return || (all_have_return && have_wildcard)) {
+ if (all_have_return && have_wildcard) {
current_suite->has_return = true;
}
#endif