summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-09-20 05:29:43 +1000
committer Vas Crabb <vas@vastheman.com>2021-09-20 05:29:43 +1000
commite135ac348d6b72e98bc5f2d5458a9f5b96e50bbe (patch)
tree3eb094419b33404a7b4fd2853f58d13fd1013353 /src/lib
parent401b22bbf50dbddc45fa99fb92249fd0c86c1bed (diff)
util/delegate.cpp: Fixed calculation of this pointer when casting member function pointers across virtual inheritance relationships using MSVC with /vmg.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/delegate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/util/delegate.cpp b/src/lib/util/delegate.cpp
index ffe3b060784..33d5f8d54e8 100644
--- a/src/lib/util/delegate.cpp
+++ b/src/lib/util/delegate.cpp
@@ -126,7 +126,8 @@ void delegate_mfp_msvc::adjust_this_pointer(delegate_generic_class *&object) con
std::uint8_t *byteptr = reinterpret_cast<std::uint8_t *>(object);
if ((sizeof(unknown_base_equiv) == m_size) && m_vt_index)
{
- std::uint8_t const *const vptr = *reinterpret_cast<std::uint8_t const *const *>(byteptr + m_vptr_offs);
+ byteptr += m_vptr_offs;
+ std::uint8_t const *const vptr = *reinterpret_cast<std::uint8_t const *const *>(byteptr);
byteptr += *reinterpret_cast<int const *>(vptr + m_vt_index);
}
if (sizeof(single_base_equiv) < m_size)