Commit d75868d0 authored by Marc Mutz's avatar Marc Mutz
Browse files

Correct return type of QXmlQueryPrivate::staticContext()


As reported by UBSan:

  qtbase/src/corelib/tools/qshareddata.h:167:13: runtime error: downcast of address 0x2ac9a801a410 which does not point to an object of type 'GenericStaticContext'
  0x2ac9a801a410: note: object is of type 'QPatternist::StaticFocusContext'
   00 00 00 00  28 95 b7 9d c9 2a 00 00  01 00 00 00 c9 2a 00 00  f0 a1 01 a8 c9 2a 00 00  70 fa 0b 02
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QPatternist::StaticFocusContext'

I had no idea how the QExplicitlySharedDataPointer conversion
could ever compile, until I saw that this module defines

   QT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST

which is, of course, utterly broken.

Change-Id: Ie392ba74438b6c75fde9fabe09f9b0e655489cd9
Reviewed-by: default avatarTobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@qt.io>
Showing with 1 addition and 1 deletion
......@@ -122,7 +122,7 @@ public:
return m_variableLoader;
}
inline QPatternist::GenericStaticContext::Ptr staticContext()
inline QPatternist::StaticContext::Ptr staticContext()
{
if(m_staticContext && m_expr)
return m_staticContext;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment