bwendling wrote: The problem with adding the code to `CodeGenFunction::EmitArraySubscriptExpr` is that we need to emit the counted_by "count" for more than just an `ArraySubscriptExpr`. Where `ExprLValueMap` is placed catches all of the expressions we're interested in. We're doing something similar to `LocalDeclMap`.
But if I placed some code in `EmitArraySubscriptExpr`, I'm guessing your suggestion is more-or-less this: ``` // Towards end of method. if (Sanitizing ArrayBounds) { if (Array is a flexible array member with a counted_by attribute) Emit the bounds checking here. } ``` I'll give it a shot. https://github.com/llvm/llvm-project/pull/73730 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits