Fix some minor issues found by --sanitize. Add --sanitizeub.

Unfortunately the ub (undefined behavior) sanitizer has some bugs, it doesn't
understand pointers to member functions, so can't use it in-game (due to the
vertex decoder).

Thanks Nemoumbra for the reminder.
This commit is contained in:
Henrik Rydgård committed 2024-07-22 11:37:18 +02:00
1 parent 1bb850578d
commit fd9daf7594
8 files changed
+40 -32

No files matched your search

+2 -1
View File
@@ -247,6 +247,7 @@ static const BindingCategory cats[] = {
{"Control modifiers", VIRTKEY_ANALOG_ROTATE_CW},
{"Emulator controls", VIRTKEY_FASTFORWARD},
{"Extended PSP controls", VIRTKEY_AXIS_RIGHT_Y_MAX},
{}, // sentinel
};
void ControlMappingScreen::CreateViews() {
@@ -313,7 +314,7 @@ void ControlMappingScreen::CreateViews() {
if (curCat >= 0 && curSection) {
curSection->SetOpenPtr(&categoryToggles_[curCat]);
}
_dbg_assert_(curCat == ARRAY_SIZE(cats) - 1);
_dbg_assert_(curCat == ARRAY_SIZE(cats) - 2); // count the sentinel
keyMapGeneration_ = KeyMap::g_controllerMapGeneration;
}