Files
Jan Engelhardt a84408d5fc ui: cure UBSAN warning about cast in UIStatic::SetTitle
```
ui/UIStatic.cpp:113:15: runtime error: downcast of address 0x7b9f03ae6a00 which does not point to an object of type 'UIPrimativeItem'
0x7b9f03ae6a00: note: object is of type 'UITextItem'
 00 00 00 00  d0 f9 57 02 00 00 00 00  ff be be be 00 ff 00 00  03 00 00 00 be be be be  70 64 dd 02
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'UITextItem'

[lines as per 51fb3fea609e81d3897c33d901dce0b7be68c082; ±1 line]
f0  UIStatic::SetTitle (this=0x7ccff4a8b200, item=0x7bfff384a030) at ui/UIStatic.cpp:113
f1  newuiSheet::UpdateChanges (this=0x7bfff3a8ee38) at Descent3/newui_core.cpp:1721
f2  newuiMenu::DoUI (this=0x7bfff3a8e4c0) at Descent3/newui_core.cpp:921
f3  OptionsMenu () at Descent3/config.cpp:1432
f4  MainMenu () at Descent3/menu.cpp:837
f5  MainLoop () at Descent3/descent.cpp:541
f6  Descent3 () at Descent3/descent.cpp:503
f7  oeD3LnxApp::run (this=0x7bfff3901050) at Descent3/sdlmain.cpp:142
f8  main (argc=1, argv=0x7fffffffdae8) at Descent3/sdlmain.cpp:322
```

In `SetTitle`, `CopyUIItem()` returns a `UIItem *` backed by the same class
that `item` is, which is not guaranteed to be a UIPrimativeItem object. That
guarantee only holds in the `SetBackground` function.

Fixes: df209742fc (bogus cast added)
Fixes: 51fb3fea60 (added UITextItem in the options dialog)
2025-05-27 00:28:01 +02:00
..
2024-09-24 23:00:53 +03:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-09-23 00:37:25 +03:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2024-11-03 23:39:38 +01:00
2025-04-12 01:57:43 -05:00
2024-11-03 23:39:38 +01:00