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

Eli Friedman via flang-commits flang-commits at lists.llvm.org
Tue Dec 12 16:30:10 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)) {
----------------
efriedma-quic wrote:

Recursively skipping over all GEPs seems, at best, extremely fragile; there could be GEPs for reasons other than the member expressions you care about.

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


More information about the flang-commits mailing list