diff options
author | Benjamin Navarro <navarro.benjamin13@gmail.com> | 2021-10-18 09:01:16 +0200 |
---|---|---|
committer | Benjamin Navarro <navarro.benjamin13@gmail.com> | 2021-10-18 09:01:16 +0200 |
commit | 560d9a4cc02077097a284f3c21ec0387b313aba7 (patch) | |
tree | 682677ef70b148871e80eef0be338853405c0e73 | |
parent | 523e0d80a8118c933dc2fb747874526cd72e1f92 (diff) |
Fix incorrect debug check for setters
the check read the return type of the setter, which doesn't exist and
lead to a segmentation fault. Now we check the first function parameter.
Probably a bad copy/paste of the getter case
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index a5b75cbfe4..cd8fd361c5 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -980,7 +980,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class) { has_valid_setter = true; #ifdef DEBUG_ENABLED - if (member.variable->datatype.builtin_type == Variant::INT && setter_function->return_type->datatype.builtin_type == Variant::FLOAT) { + if (member.variable->datatype.builtin_type == Variant::FLOAT && setter_function->parameters[0]->datatype.builtin_type == Variant::INT) { parser->push_warning(member.variable, GDScriptWarning::NARROWING_CONVERSION); } #endif |