================ @@ -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:
Okay, but that seems incredibly fragile. It'll be bypassing the code in `EmitLValue`. Wouldn't it be better to do it in the opposite way? Allow `EmitLValue` to do its thing. It'll return a GEP. I can then use `ArrayLV.getAddress(*this)` to build a GEP to `count` without re-loading the base pointer? 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