[clang] [clang-tools-extra] [libc] [flang] [compiler-rt] [llvm] [libcxx] [Clang] Generate the GEP instead of adding AST nodes (PR #73730)

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 15 12:17:21 PST 2023


================
@@ -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:

I should say that I'm not *certain* that `ptr->arr` in the middle case will see `struct A` as its most-enclosing struct. I need to check on it.

https://github.com/llvm/llvm-project/pull/73730


More information about the cfe-commits mailing list