[clang][Modules] Fix the Size of RecordDecl's BitCodeAbbrevOp (#133500)

https://github.com/llvm/llvm-project/pull/102040/files#diff-125f472e690aa3d973bc42aa3c5d580226c5c47661551aca2889f960681aa64dR2477
added 1 bit to `RecordDecl`'s serialization format, but did not
increment its abbreviation size.

This can lead to rare cases where a record may overflow if the
`RecordDecl`'s `getArgPassingRestrictions()` returns something bigger
than 1 (see
[here](b3f01a6aa4/clang/lib/Serialization/ASTWriterDecl.cpp (L688))).

rdar://143763558
This commit is contained in:
Qiongsi Wu 2025-04-01 12:55:17 -07:00 committed by GitHub
parent 23fb048ce3
commit 4a73c99329
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2579,7 +2579,7 @@ void ASTWriter::WriteDeclAbbrevs() {
// RecordDecl
Abv->Add(BitCodeAbbrevOp(
BitCodeAbbrevOp::Fixed,
13)); // Packed Record Decl Bits: FlexibleArrayMember,
14)); // Packed Record Decl Bits: FlexibleArrayMember,
// AnonymousStructUnion, hasObjectMember, hasVolatileMember,
// isNonTrivialToPrimitiveDefaultInitialize,
// isNonTrivialToPrimitiveCopy, isNonTrivialToPrimitiveDestroy,