summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/delegate.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-03-20 14:04:04 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-03-20 14:04:04 +0100
commit13453b312f20c632561d6c83f57e1197143beddd (patch)
tree6ec866ca7482244f5e48552e8a9822629bb0bc86 /src/lib/util/delegate.cpp
parente0221f47d765a2931fc10822d6bbd6ddbaabcd43 (diff)
Fixed delegates for ARM and MIPS (nw)
Diffstat (limited to 'src/lib/util/delegate.cpp')
-rw-r--r--src/lib/util/delegate.cpp7
1 files changed, 2 insertions, 5 deletions
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<delegate_generic_class *>(reinterpret_cast<std::uint8_t *>(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<delegate_generic_class *>(reinterpret_cast<std::uint8_t *>(object) + m_this_delta);
return reinterpret_cast<delegate_generic_function>(m_function);
}
object = reinterpret_cast<delegate_generic_class *>(reinterpret_cast<std::uint8_t *>(object));