[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 15:02:44 PDT 2024


================
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
     InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
   }
 
-  if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+  if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID &&
+      !CountInBytes) {
----------------
rapidsna wrote:

I agree with @delcypher. 

https://github.com/llvm/llvm-project/pull/93231


More information about the cfe-commits mailing list