diff options
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx index 6af52e9e471a..16f6ba27c0f4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx @@ -32,6 +32,7 @@ #include <stdio.h> //#include <string.h> #include <cstring> +#include <typeinfo> using namespace com::sun::star::uno; @@ -709,7 +710,7 @@ void bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const* bpt struct bridges::cpp_uno::shared::VtableFactory::Slot { - void* fn; + void const* fn; }; bridges::cpp_uno::shared::VtableFactory::Slot* @@ -723,6 +724,15 @@ std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize(sal_Int32 slot return (slotCount + 2) * sizeof(Slot) + slotCount * codeSnippetSize; } +namespace +{ +// Some dummy type whose RTTI is used in the synthesized proxy vtables to make uses of dynamic_cast +// on such proxy objects not crash: +struct ProxyRtti +{ +}; +} + bridges::cpp_uno::shared::VtableFactory::Slot* bridges::cpp_uno::shared::VtableFactory::initializeBlock(void* block, sal_Int32 slotCount, sal_Int32, @@ -730,7 +740,7 @@ bridges::cpp_uno::shared::VtableFactory::initializeBlock(void* block, sal_Int32 { Slot* slots = mapBlockToVtable(block); slots[-2].fn = 0; //null - slots[-1].fn = 0; //destructor + slots[-1].fn = &typeid(ProxyRtti); return slots + slotCount; } |