Skip to content

Remove useless BaseDataMap subclasses

Waqar Ahmed requested to merge work/simplify-datamap into master

All derived classes are doing exactly nothing so they are not needed. DataMap is just storing a value against a pointer value. We don't need subclasses for that.

Instead we can just store the typed erased pointer as void * and remove all uneeded virtual stuff.

This fixes warnings from ubsan such as:

kstyle/breezestyle.cpp:1374:31: runtime error: downcast of address 0x7ffc93ad4c60 which does not point to an object of type 'const QWidget'
0x7ffc93ad4c60: note: object has a possibly invalid vptr: abs(offset to top) too big
 e0 50 00 00  40 55 07 00 00 51 00 00  00 08 5c 2d 24 7f 00 00  48 5d 81 35 24 7f 00 00  01 00 01 00

Merge request reports