================ @@ -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:
@rapidsna It would ignore that case, because it could have side-effects. But if it's the base pointer, it could be reused. I added a method in the visitor. I quickly tried the `CodeGenFunction::EmitLValueForField` method. Does it work with fields that aren't at the top level? At first glance, it doesn't appear to do that. @efriedma-quic Okay. I changed it to look through the GEPs for 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