[PATCH] D77374: Fix -fsanitize=array-bounds with comma operator

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 14:24:58 PDT 2020


vitalybuka marked an inline comment as done.
vitalybuka added inline comments.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:882-887
+  while (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) {
+    if (!BO->isCommaOp())
+      break;
+    E = BO->getRHS();
+    E = E->IgnoreParens();
+  }
----------------
rsmith wrote:
> If we're going to further extend what Clang considers to be a flexible array access, we should do so consistently across our warning machinery and our sanitizers. Perhaps we could start by unifying this function with `IsTailPaddedMemberArray` in `SemaChecking`?
There is one place in external code which is blocking me from enabling this at Google.

How much work it's going to be? To me these functions looks very different.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77374/new/

https://reviews.llvm.org/D77374





More information about the cfe-commits mailing list