From 13453b312f20c632561d6c83f57e1197143beddd Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 Mar 2016 14:04:04 +0100 Subject: Fixed delegates for ARM and MIPS (nw) --- src/lib/util/delegate.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib/util/delegate.cpp') diff --git a/src/lib/util/delegate.cpp b/src/lib/util/delegate.cpp index 9c9e0fd3bf7..52a36811dfa 100644 --- a/src/lib/util/delegate.cpp +++ b/src/lib/util/delegate.cpp @@ -40,14 +40,11 @@ delegate_mfp::raw_mfp_data delegate_mfp::s_null_mfp = { {0 }}; delegate_generic_function delegate_mfp::convert_to_generic(delegate_generic_class *&object) const { #if defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) - // apply the "this" delta to the object first - object = reinterpret_cast(reinterpret_cast(object)); - - // if the low bit of the vtable index is clear, then it is just a raw function pointer - if (m_this_delta==0) { + if ((m_this_delta & 1) == 0) { #if defined(LOG_DELEGATES) printf("Calculated Addr = %08x\n", (uintptr_t)(void*)(m_function)); #endif + object = reinterpret_cast(reinterpret_cast(object) + m_this_delta); return reinterpret_cast(m_function); } object = reinterpret_cast(reinterpret_cast(object)); -- cgit v1.2.3-70-g09d2