================
@@ -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)) {
----------------
rapidsna wrote:

@rjmccall @bwendling I have documentation clarifying what are the restrictions 
for __counted_by 
https://github.com/rapidsna/llvm-project/pull/1/commits/4a6a041267b3399eab46c3bb88e3d023d4050836.
 I was planning to land it after my initial documentation lands 
https://github.com/llvm/llvm-project/pull/70749.

@bwendling In general, the same name/expression rules should apply to 
`__counted_by` used in pointers and arrays. I clarified that in 
https://github.com/rapidsna/llvm-project/pull/1/commits/4a6a041267b3399eab46c3bb88e3d023d4050836.
 I synched with GCC folks and they agreed that the syntax and semantics should 
not diverge between the full `-fbounds-safety` mode and the mode only using the 
annotations for `__bdos` and sanitizers.



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

Reply via email to