[Clang-tools-extra] Add missing values to CharacteristicKindStrings (#205455)

Static analysis flagged that we were indexing CharacteristicKindStrings
in PPCallbacksTracker::FileChanged based on the values of
SrcMgr::CharacteristicKind which would access outside array bounds for
some values of the enum. As far I can see all value of the enum are
possible when calling FileChanged and so the array should indeed cover
all values. So I added the missing values to the array.
This commit is contained in:
Shafik Yaghmour 2026-06-25 10:55:10 -07:00 committed by GitHub
parent ebc2f7946a
commit ab3d63cc08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,8 +60,9 @@ static const char *const FileChangeReasonStrings[] = {
};
// CharacteristicKind strings.
static const char *const CharacteristicKindStrings[] = { "C_User", "C_System",
"C_ExternCSystem" };
static const char *const CharacteristicKindStrings[] = {
"C_User", "C_System", "C_ExternCSystem", "C_User_ModuleMap",
"C_System_ModuleMap"};
// MacroDirective::Kind strings.
static const char *const MacroDirectiveKindStrings[] = {