================
@@ -4610,6 +4627,26 @@ void CodeGenFunction::EmitArrayBoundsConstraints(const
ArraySubscriptExpr *E,
if (ArraySize == 0)
return;
+ // Don't generate assumes for flexible array member pattern.
+ // Arrays of size 1 in structs are often used as placeholders for
+ // variable-length data (pre-C99 flexible array member idiom.)
+ if (ArraySize == 1) {
----------------
Meinersbur wrote:
The idiom can also be [zero-length
array](https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html).
https://github.com/llvm/llvm-project/pull/159046
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits