summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-10 13:10:00 +0100
committerGitHub <noreply@github.com>2020-03-10 13:10:00 +0100
commitcdbf0332902d34cfb3be7899fb738b5447bbb755 (patch)
treeb58773178d9cc1ccabd0890464c3b0018fd5de69 /modules/gdscript
parent57ab10ccf3d20d56bbaed3cd9c72ffd914a3a2e3 (diff)
parent5424b626f96c0fb9e00610036236e3e6c67eda55 (diff)
Merge pull request #36704 from ThakeeNathees/gdscript-duplicate-args-fix
GDScript duplicate arguments bug fixed
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_parser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 4155f1ca0b..353c79d6bb 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3809,6 +3809,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
}
StringName argname = tokenizer->get_token_identifier();
+ for (int i = 0; i < arguments.size(); i++) {
+ if (arguments[i] == argname) {
+ _set_error("The argument name \"" + String(argname) + "\" is defined multiple times.");
+ return;
+ }
+ }
arguments.push_back(argname);
#ifdef DEBUG_ENABLED
arguments_usage.push_back(0);