qt6-bb10/src
Marc Mutz bc087db590 QtTest: fix UB in QSpontaneKeyEvent::setSpontaneous()
Found by UBSan:

  src/testlib/qtestspontaneevent.h:95:38: runtime error: member call on address 0x7ffc33019650 which does not point to an object of type 'QSpontaneKeyEvent' 0x7ffc33019650: note: object is of type 'QMouseEvent'
  83 2b 00 00  98 e8 fa 8e 83 2b 00 00  00 00 00 00 00 00 00 00  02 00 04 00 00 00 00 00  00 00 00 00
               ^~~~~~~~~~~~~~~~~~~~~~~
               vptr for 'QMouseEvent'

  src/testlib/qtestspontaneevent.h:95:38: runtime error: member call on address 0x7ffc330196e0 which does not point to an object of type 'QSpontaneKeyEvent' 0x7ffc330196e0: note: object is of type 'QKeyEvent'
  00 00 00 00  f8 e8 fa 8e 83 2b 00 00  00 00 00 00 00 00 00 00  07 00 04 00 00 00 00 00  00 00 00 00
               ^~~~~~~~~~~~~~~~~~~~~~~
               vptr for 'QKeyEvent'

Fix by providing setSpontaneous() on QEvent as a private function and
befriending QSpontaneKeyEvent. Make setSpontaneous() always-inline to
avoid BiC between 5.6.0 and 5.6.1.

Change-Id: Ic60d82ed6a858f4f13f41fa3d2d1db6e808896b7
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-07 16:13:33 +00:00
..
3rdparty Bundled HarfBuzz: simplify the built-in shapers list configuration 2016-03-07 14:04:53 +00:00
android Android: Fix immersive mode 2016-02-19 11:42:05 +00:00
angle rework include path construction in the module system 2016-01-12 15:14:57 +00:00
concurrent consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
corelib QtTest: fix UB in QSpontaneKeyEvent::setSpontaneous() 2016-03-07 16:13:33 +00:00
dbus consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
gui consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
network consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
opengl consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
openglextensions consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
platformheaders Expose the number of X screen through the QXcbScreenFunctions 2016-03-05 10:46:41 +00:00
platformsupport QCoreTextFontDatabase: Get rid of local fallbacksForFamily cache 2016-03-07 14:05:12 +00:00
plugins standardize statement order in project file a bit 2016-03-07 14:09:58 +00:00
printsupport consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
sql consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
testlib QtTest: fix UB in QSpontaneKeyEvent::setSpontaneous() 2016-03-07 16:13:33 +00:00
tools consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
widgets consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
winmain winrt: handle PrelaunchActivated property to pass certification 2016-01-05 13:04:09 +00:00
xml consistently put {qt,qml}_{module,plugin} at the end of project files 2016-03-07 14:09:49 +00:00
src.pro rework include path construction in the module system 2016-01-12 15:14:57 +00:00