diff options
-rw-r--r-- | core/class_db.cpp | 5 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.cpp | 2 | ||||
-rwxr-xr-x | misc/travis/clang-format.sh | 14 | ||||
-rw-r--r-- | modules/gdscript/gdscript.cpp | 1 | ||||
-rw-r--r-- | modules/gdscript/gdscript.h | 1 | ||||
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 15 | ||||
-rw-r--r-- | modules/gdscript/gdscript_function.h | 2 |
7 files changed, 20 insertions, 20 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp index 2fd0ee2d89..a2941d70f6 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -1410,10 +1410,7 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con cleanup_c = false; } else if (ClassDB::can_instance(p_class)) { c = ClassDB::instance(p_class); -#ifndef _MSC_VER -#warning FIXME: ObjectID refactoring broke GDScript handling of reference pointers, this needs a proper fix. -#endif - cleanup_c = (p_class != StringName("GDScript")); + cleanup_c = true; } if (c) { diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index f7e412be63..4adeeb1d9b 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -676,8 +676,6 @@ void NetSocketPosix::set_reuse_address_enabled(bool p_enabled) { // On Windows, enabling SO_REUSEADDR actually would also enable reuse port, very bad on TCP. Denying... // Windows does not have this option, SO_REUSEADDR in this magical world means SO_REUSEPORT #ifndef WINDOWS_ENABLED - if (_is_stream) - return; int par = p_enabled ? 1 : 0; if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, SOCK_CBUF(&par), sizeof(int)) < 0) { WARN_PRINT("Unable to set socket REUSEADDR option!"); diff --git a/misc/travis/clang-format.sh b/misc/travis/clang-format.sh index 097b2a9378..a6585578e1 100755 --- a/misc/travis/clang-format.sh +++ b/misc/travis/clang-format.sh @@ -3,11 +3,17 @@ CLANG_FORMAT=clang-format-8 if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - # Check the whole commit range against $TRAVIS_BRANCH, the base merge branch - # We could use $TRAVIS_COMMIT_RANGE but it doesn't play well with force pushes - RANGE="$(git rev-parse $TRAVIS_BRANCH) HEAD" + # Travis only clones the PR branch and uses its HEAD commit as detached HEAD, + # so it's problematic when we want an exact commit range for format checks. + # We fetch upstream to ensure that we have the proper references to resolve. + # Ideally we would use $TRAVIS_COMMIT_RANGE but it doesn't play well with PR + # updates, as it only includes changes since the previous state of the PR. + git remote add upstream https://github.com/godotengine/godot \ + --no-tags -f -t $TRAVIS_BRANCH + RANGE="upstream/$TRAVIS_BRANCH HEAD" else - # Test only the last commit + # Test only the last commit, since $TRAVIS_COMMIT_RANGE wouldn't support + # force pushes. RANGE=HEAD fi diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index a73276dda2..6d926fb88d 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -995,7 +995,6 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const { GDScript::GDScript() : script_list(this) { - _static_ref = this; valid = false; subclass_count = 0; initializer = NULL; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 103de3304e..3e60028281 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -73,7 +73,6 @@ class GDScript : public Script { friend class GDScriptFunctions; friend class GDScriptLanguage; - Variant _static_ref; //used for static call Ref<GDScriptNativeClass> native; Ref<GDScript> base; GDScript *_base; //fast pointer access diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index cbf7d81a61..1931d5f160 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -34,7 +34,7 @@ #include "gdscript.h" #include "gdscript_functions.h" -Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant *p_stack, String &r_error) const { +Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const { int address = p_address & ADDR_MASK; @@ -52,7 +52,7 @@ Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_insta } break; case ADDR_TYPE_CLASS: { - return &p_script->_static_ref; + return &static_ref; } break; case ADDR_TYPE_MEMBER: { #ifdef DEBUG_ENABLED @@ -270,6 +270,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a r_err.error = Variant::CallError::CALL_OK; Variant self; + Variant static_ref; Variant retvalue; Variant *stack = NULL; Variant **call_args; @@ -404,10 +405,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #define CHECK_SPACE(m_space) \ GD_ERR_BREAK((ip + m_space) > _code_size) -#define GET_VARIANT_PTR(m_v, m_code_ofs) \ - Variant *m_v; \ - m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, stack, err_text); \ - if (unlikely(!m_v)) \ +#define GET_VARIANT_PTR(m_v, m_code_ofs) \ + Variant *m_v; \ + m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, static_ref, stack, err_text); \ + if (unlikely(!m_v)) \ OPCODE_BREAK; #else @@ -415,7 +416,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #define CHECK_SPACE(m_space) #define GET_VARIANT_PTR(m_v, m_code_ofs) \ Variant *m_v; \ - m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, stack, err_text); + m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, static_ref, stack, err_text); #endif diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index 7b7bcbaac9..2c432360ba 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -265,7 +265,7 @@ private: List<StackDebug> stack_debug; - _FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant *p_stack, String &r_error) const; + _FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const; _FORCE_INLINE_ String _get_call_error(const Variant::CallError &p_err, const String &p_where, const Variant **argptrs) const; friend class GDScriptLanguage; |