From 947d7c83294faf4da808c184c12d65d7f2382796 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 31 Mar 2022 18:35:56 +0300 Subject: [PATCH] Fix some issues found by clang sanitizers. --- core/object/method_bind.h | 6 +++--- modules/gdscript/gdscript.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/object/method_bind.h b/core/object/method_bind.h index 27098571e3f6..bde6cba1993a 100644 --- a/core/object/method_bind.h +++ b/core/object/method_bind.h @@ -214,7 +214,7 @@ public: private: PropertyInfo _gen_return_type_info() const { - return reinterpret_cast(this)->_gen_return_type_info_impl(); + return Derived::_gen_return_type_info_impl(); } }; @@ -237,7 +237,7 @@ public: } private: - PropertyInfo _gen_return_type_info_impl() const { + static PropertyInfo _gen_return_type_info_impl() { return {}; } }; @@ -267,7 +267,7 @@ public: } private: - PropertyInfo _gen_return_type_info_impl() const { + static PropertyInfo _gen_return_type_info_impl() { return GetTypeInfo::get_class_info(); } }; diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index d415684d10db..3a0e320e9b79 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -824,7 +824,7 @@ Error GDScript::reload(bool p_keep_state) { // Loading a template, don't parse. #ifdef TOOLS_ENABLED - if (basedir.begins_with(EditorSettings::get_singleton()->get_project_script_templates_dir())) { + if (EditorSettings::get_singleton() && basedir.begins_with(EditorSettings::get_singleton()->get_project_script_templates_dir())) { return OK; } #endif