================ @@ -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)) { ---------------- efriedma-quic wrote:
Yes. You should be able to refactor some code out of CodeGenFunction::EmitMemberExpr so it's not a completely independent codepath. I mean, I see why you're concerned about re-implementing EmitMemberExpr, but fragility isn't just about simplifying the control flow within the compiler; the nastiest problems are caused by one piece of code making assumptions about how an apparently unrelated part of the code behaves. 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