diff options
author | Thakee Nathees <thakeenathees@gmail.com> | 2021-01-03 18:44:01 +0530 |
---|---|---|
committer | Thakee Nathees <thakeenathees@gmail.com> | 2021-01-03 18:44:01 +0530 |
commit | 01c11ec29b9e8dce549400a01e667a9c89f073d1 (patch) | |
tree | badbeb02cd9e6b61db677905806dbe797f010fbc /modules | |
parent | 7d972b8c67412571e5ceb1d975aa5161e4e9e27b (diff) |
GDScript builtin invalid function call crash fix
Fix: #44852
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 19951ff17d..7f3dff7dfc 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -2029,14 +2029,14 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool is_awa push_error(vformat(R"*(Name "%s" called as a function but is a "%s".)*", p_call->function_name, callee_datatype.to_string()), p_call->callee); } #ifdef DEBUG_ENABLED - } else if (!is_self) { + } else if (!is_self && !(base_type.is_hard_type() && base_type.kind == GDScriptParser::DataType::BUILTIN)) { parser->push_warning(p_call, GDScriptWarning::UNSAFE_METHOD_ACCESS, p_call->function_name, base_type.to_string()); mark_node_unsafe(p_call); #endif } } } - if (!found && is_self) { + if (!found && (is_self || (base_type.is_hard_type() && base_type.kind == GDScriptParser::DataType::BUILTIN))) { String base_name = is_self && !p_call->is_super ? "self" : base_type.to_string(); push_error(vformat(R"*(Function "%s()" not found in base %s.)*", p_call->function_name, base_name), p_call->is_super ? p_call : p_call->callee); } |