diff options
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index 5491e0153b7e..7e8524d1c726 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -18,6 +18,7 @@ */ #include <malloc.h> +#include <typeinfo> #include <rtl/alloc.h> @@ -629,7 +630,7 @@ namespace } } -struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; +struct bridges::cpp_uno::shared::VtableFactory::Slot { void const * fn; }; bridges::cpp_uno::shared::VtableFactory::Slot * bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) @@ -643,6 +644,12 @@ std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( 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, @@ -650,7 +657,7 @@ bridges::cpp_uno::shared::VtableFactory::initializeBlock( { Slot * slots = mapBlockToVtable(block); slots[-2].fn = 0; - slots[-1].fn = 0; + slots[-1].fn = &typeid(ProxyRtti); return slots + slotCount; } |