================ @@ -4022,8 +4169,36 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, ArrayLV = EmitArraySubscriptExpr(ASE, /*Accessed*/ true); else ArrayLV = EmitLValue(Array); + auto *Idx = EmitIdxAfterBase(/*Promote*/true); + if (SanOpts.has(SanitizerKind::ArrayBounds)) { ---------------- bwendling wrote:
Forcing the `count` to be in the top-level struct was more-or-less a compromise in how the `__counted_by` field is specified. It might be too restrictive, or not restrictive enough (depending on your point of view). I personally would prefer a different way of specifying where the `count` is, ですけど.... (My idea is to use a form of the "designated initializer" syntax (maybe with a way to specify a "relative path?" ... dunno).) If supporting a FAM in a substructure is too hairy, I can remove that support until we work out the kinks. (I think GCC doesn't yet have support for this.) 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